|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77663 - in trunk/libs/scope_exit: example test
From: lorcaminiti_at_[hidden]
Date: 2012-03-31 09:27:40
Author: lcaminiti
Date: 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
New Revision: 77663
URL: http://svn.boost.org/trac/boost/changeset/77663
Log:
Using Boost.Detail/LightweightTest instead of Boost.Test for ScopeExit tests and examples (because Boost.Test fails to build on some regression test platforms and because this library tests are simple enough that they don't really require Boost.Test).
Removed:
trunk/libs/scope_exit/test/world_checkpoint_all_nova.cpp
Text files modified:
trunk/libs/scope_exit/example/Jamfile.v2 | 7 --
trunk/libs/scope_exit/example/world_lambda.cpp | 8 +-
trunk/libs/scope_exit/test/Jamfile.v2 | 7 --
trunk/libs/scope_exit/test/native.cpp | 105 +++++++++++++++++++--------------------
trunk/libs/scope_exit/test/native_this.cpp | 17 ++----
trunk/libs/scope_exit/test/native_this_tpl.cpp | 17 ++----
trunk/libs/scope_exit/test/native_tpl.cpp | 30 ++++-------
trunk/libs/scope_exit/test/native_tu1.cpp | 4 -
trunk/libs/scope_exit/test/native_tu2.cpp | 4 -
trunk/libs/scope_exit/test/native_tu_test.cpp | 15 ++---
trunk/libs/scope_exit/test/same_line.cpp | 11 ++-
trunk/libs/scope_exit/test/same_line_seq.cpp | 11 ++-
trunk/libs/scope_exit/test/tu_test.hpp | 2
trunk/libs/scope_exit/test/world.cpp | 8 +-
trunk/libs/scope_exit/test/world_checkpoint.cpp | 13 ++--
trunk/libs/scope_exit/test/world_checkpoint_all.cpp | 13 ++--
trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp | 13 ++--
trunk/libs/scope_exit/test/world_checkpoint_seq.cpp | 13 ++--
trunk/libs/scope_exit/test/world_seq.cpp | 8 +-
trunk/libs/scope_exit/test/world_this.cpp | 8 +-
trunk/libs/scope_exit/test/world_this_seq.cpp | 8 +-
trunk/libs/scope_exit/test/world_tpl.cpp | 8 +-
trunk/libs/scope_exit/test/world_tpl_seq.cpp | 8 +-
trunk/libs/scope_exit/test/world_void.cpp | 8 +-
24 files changed, 156 insertions(+), 190 deletions(-)
Modified: trunk/libs/scope_exit/example/Jamfile.v2
==============================================================================
--- trunk/libs/scope_exit/example/Jamfile.v2 (original)
+++ trunk/libs/scope_exit/example/Jamfile.v2 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -8,13 +8,6 @@
import testing ;
-project
- : requirements
- <library>/boost/test//boost_test_exec_monitor
- <library>/boost//unit_test_framework
- <link>static
- ;
-
run try_catch.cpp ;
run try_catch_seq.cpp ;
run try_catch_seq_nova.cpp ;
Modified: trunk/libs/scope_exit/example/world_lambda.cpp
==============================================================================
--- trunk/libs/scope_exit/example/world_lambda.cpp (original)
+++ trunk/libs/scope_exit/example/world_lambda.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -11,8 +11,7 @@
# error "lambda functions required"
#else
-#define BOOST_TEST_MODULE TestWorldLambda
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
struct person {};
@@ -46,11 +45,12 @@
}
//]
-BOOST_AUTO_TEST_CASE(test_world_lambda) {
+int main(void) {
world w;
person p;
w.add_person(p);
- BOOST_CHECK(w.persons_.size() == 1);
+ BOOST_TEST(w.persons_.size() == 1);
+ return boost::report_errors();
}
#endif // lambdas
Modified: trunk/libs/scope_exit/test/Jamfile.v2
==============================================================================
--- trunk/libs/scope_exit/test/Jamfile.v2 (original)
+++ trunk/libs/scope_exit/test/Jamfile.v2 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -8,13 +8,6 @@
import testing ;
-project
- : requirements
- <library>/boost/test//boost_test_exec_monitor
- <library>/boost//unit_test_framework
- <link>static
- ;
-
test-suite doc_tests
: [ run same_line.cpp ]
[ run same_line_seq.cpp ]
Modified: trunk/libs/scope_exit/test/native.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native.cpp (original)
+++ trunk/libs/scope_exit/test/native.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,13 +10,11 @@
#include <boost/config.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <iostream>
#include <ostream>
#include <string>
-using namespace boost::unit_test;
-
std::string g_str;
template<int Dummy = 0>
@@ -31,19 +29,19 @@
int i = 0;
BOOST_SCOPE_EXIT(void) {
- BOOST_CHECK(Holder<>::g_long == 3);
+ BOOST_TEST(Holder<>::g_long == 3);
} BOOST_SCOPE_EXIT_END
BOOST_SCOPE_EXIT( (i) ) {
- BOOST_CHECK(i == 0);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_TEST(i == 0);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
} BOOST_SCOPE_EXIT_END
BOOST_SCOPE_EXIT( (&i) ) {
- BOOST_CHECK(i == 3);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_TEST(i == 3);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
} BOOST_SCOPE_EXIT_END
{
@@ -63,25 +61,25 @@
} catch(...) {}
} BOOST_SCOPE_EXIT_END
- BOOST_CHECK(i == 0);
- BOOST_CHECK(g_str == "");
- BOOST_CHECK(Holder<>::g_long == 1);
+ BOOST_TEST(i == 0);
+ BOOST_TEST(g_str == "");
+ BOOST_TEST(Holder<>::g_long == 1);
}
- BOOST_CHECK(Holder<>::g_long == 2);
- BOOST_CHECK(g_str == "g_str");
- BOOST_CHECK(i == 1); // Check that first declared is executed last.
+ BOOST_TEST(Holder<>::g_long == 2);
+ BOOST_TEST(g_str == "g_str");
+ BOOST_TEST(i == 1); // Check that first declared is executed last.
BOOST_SCOPE_EXIT( (&i) ) {
- BOOST_CHECK(i == 3);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_TEST(i == 3);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
} BOOST_SCOPE_EXIT_END
BOOST_SCOPE_EXIT( (i) ) {
- BOOST_CHECK(i == 1);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_TEST(i == 1);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
} BOOST_SCOPE_EXIT_END
try {
@@ -95,15 +93,15 @@
Holder<>::g_long = 3;
} BOOST_SCOPE_EXIT_END
- BOOST_CHECK(i == 1);
- BOOST_CHECK(g_str == "g_str");
- BOOST_CHECK(Holder<>::g_long == 2);
+ BOOST_TEST(i == 1);
+ BOOST_TEST(g_str == "g_str");
+ BOOST_TEST(Holder<>::g_long == 2);
throw 0;
} catch(int) {
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
- BOOST_CHECK(i == 3); // Check that first declared is executed last.
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
+ BOOST_TEST(i == 3); // Check that first declared is executed last.
}
}
@@ -125,12 +123,12 @@
pf = &foo;
- BOOST_CHECK(results[0] == false);
- BOOST_CHECK(results[1] == false);
+ BOOST_TEST(results[0] == false);
+ BOOST_TEST(results[1] == false);
}
- BOOST_CHECK(results[0] == true);
- BOOST_CHECK(results[1] == true);
+ BOOST_TEST(results[0] == true);
+ BOOST_TEST(results[1] == true);
{
BOOST_SCOPE_EXIT( (&results) (pf) ) {
@@ -142,16 +140,16 @@
pf = 0;
- BOOST_CHECK(results[0] == true);
- BOOST_CHECK(results[1] == true);
+ BOOST_TEST(results[0] == true);
+ BOOST_TEST(results[1] == true);
}
- BOOST_CHECK(pf == 0);
- BOOST_CHECK(results[0] == false);
- BOOST_CHECK(results[1] == false);
+ BOOST_TEST(pf == 0);
+ BOOST_TEST(results[0] == false);
+ BOOST_TEST(results[1] == false);
}
-void test_cpp11(void) {
+void test_capture_all(void) {
#ifndef BOOST_NO_LAMBDAS
int i = 0, j = 1;
@@ -160,38 +158,37 @@
i = j = 1; // modify copies
};
}
- BOOST_CHECK(i == 0);
- BOOST_CHECK(j == 1);
+ BOOST_TEST(i == 0);
+ BOOST_TEST(j == 1);
{
BOOST_SCOPE_EXIT_ALL(&) {
i = 1;
j = 2;
};
- BOOST_CHECK(i == 0);
- BOOST_CHECK(j == 1);
+ BOOST_TEST(i == 0);
+ BOOST_TEST(j == 1);
}
- BOOST_CHECK(i == 1);
- BOOST_CHECK(j == 2);
+ BOOST_TEST(i == 1);
+ BOOST_TEST(j == 2);
{
BOOST_SCOPE_EXIT_ALL(=, &j) {
i = 2; // modify a copy
j = 3;
};
- BOOST_CHECK(i == 1);
- BOOST_CHECK(j == 2);
+ BOOST_TEST(i == 1);
+ BOOST_TEST(j == 2);
}
- BOOST_CHECK(i == 1);
- BOOST_CHECK(j == 3);
+ BOOST_TEST(i == 1);
+ BOOST_TEST(j == 3);
#endif // lambdas
}
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_non_local));
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_types));
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_cpp11));
- return 0;
+int main(void) {
+ test_non_local();
+ test_types();
+ test_capture_all();
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/native_this.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_this.cpp (original)
+++ trunk/libs/scope_exit/test/native_this.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,9 +10,7 @@
#include <boost/config.hpp>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
struct this_tester;
BOOST_TYPEOF_REGISTER_TYPE(this_tester) // Register before `this_` capture.
@@ -22,12 +20,12 @@
value_ = -1;
BOOST_SCOPE_EXIT( (this_) ) {
- BOOST_CHECK(this_->value_ == 0);
+ BOOST_TEST(this_->value_ == 0);
} BOOST_SCOPE_EXIT_END
#ifndef BOOST_NO_LAMBDAS
BOOST_SCOPE_EXIT_ALL(&, this) {
- BOOST_CHECK(this->value_ == 0);
+ BOOST_TEST(this->value_ == 0);
};
#endif // lambdas
@@ -38,11 +36,8 @@
int value_;
};
-void test_this(void) { this_tester().check(); }
-
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_this));
- return 0;
+int main(void) {
+ this_tester().check();
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/native_this_tpl.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_this_tpl.cpp (original)
+++ trunk/libs/scope_exit/test/native_this_tpl.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,9 +10,7 @@
#include <boost/config.hpp>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
template<typename T>
struct this_tester;
@@ -24,12 +22,12 @@
value_ = -1;
BOOST_SCOPE_EXIT_TPL( (this_) ) {
- BOOST_CHECK(this_->value_ == 0);
+ BOOST_TEST(this_->value_ == 0);
} BOOST_SCOPE_EXIT_END
#ifndef BOOST_NO_LAMBDAS
BOOST_SCOPE_EXIT_ALL(&, this) {
- BOOST_CHECK(this->value_ == 0);
+ BOOST_TEST(this->value_ == 0);
};
#endif // lambdas
@@ -40,11 +38,8 @@
T value_;
};
-void test_this_tpl(void) { this_tester<int>().check(); }
-
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_this_tpl));
- return 0;
+int main(void) {
+ this_tester<int>().check();
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/native_tpl.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_tpl.cpp (original)
+++ trunk/libs/scope_exit/test/native_tpl.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,13 +10,9 @@
#include <boost/rational.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
-#include <boost/test/unit_test.hpp>
-#include <iostream>
-#include <ostream>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
-using namespace boost::unit_test;
-
template<class type>
void tpl_long(
type tval
@@ -35,12 +31,12 @@
++tv;
} BOOST_SCOPE_EXIT_END
- BOOST_CHECK(t == remember);
- BOOST_CHECK(tval == remember);
+ BOOST_TEST(t == remember);
+ BOOST_TEST(tval == remember);
}
- BOOST_CHECK(tval == 1);
- BOOST_CHECK(t == remember + 2);
+ BOOST_TEST(tval == 1);
+ BOOST_TEST(t == remember + 2);
}
template<class Vector, int Value>
@@ -57,25 +53,21 @@
vval.push_back(Value);
} BOOST_SCOPE_EXIT_END
- BOOST_CHECK(v.size() == remember.size());
- BOOST_CHECK(vval.size() == remember.size());
+ BOOST_TEST(v.size() == remember.size());
+ BOOST_TEST(vval.size() == remember.size());
}
- BOOST_CHECK(v.size() == 1 + remember.size());
- BOOST_CHECK(vval.size() == 1 + remember.size());
+ BOOST_TEST(v.size() == 1 + remember.size());
+ BOOST_TEST(vval.size() == 1 + remember.size());
}
-void test_tpl(void) {
+int main(void) {
long l = 137;
tpl_long(l, l, l, l, l);
std::vector<int> v(10, 137);
tpl_vector<std::vector<int>, 13>(v, v, v);
-}
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit TPL";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_tpl));
- return 0;
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/native_tu1.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_tu1.cpp (original)
+++ trunk/libs/scope_exit/test/native_tu1.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -8,7 +8,5 @@
#include "tu_test.hpp"
-int tu1(void) {
- return inline_f() + template_f(1);
-}
+int tu1(void) { return inline_f() + template_f(1); }
Modified: trunk/libs/scope_exit/test/native_tu2.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_tu2.cpp (original)
+++ trunk/libs/scope_exit/test/native_tu2.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -8,7 +8,5 @@
#include "tu_test.hpp"
-int tu2(void) {
- return inline_f() + template_f(2);
-}
+int tu2(void) { return inline_f() + template_f(2); }
Modified: trunk/libs/scope_exit/test/native_tu_test.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_tu_test.cpp (original)
+++ trunk/libs/scope_exit/test/native_tu_test.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -7,18 +7,15 @@
// Home at http://www.boost.org/libs/scope_exit
#include "tu_test.hpp"
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
void test(void) {
- BOOST_CHECK(tu1() == 1);
- BOOST_CHECK(tu2() == 2);
+ BOOST_TEST(tu1() == 1);
+ BOOST_TEST(tu2() == 2);
}
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "TU unit test for ScopeExit";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test));
- return 0;
+int main(void) {
+ test();
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/same_line.cpp
==============================================================================
--- trunk/libs/scope_exit/test/same_line.cpp (original)
+++ trunk/libs/scope_exit/test/same_line.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -13,8 +13,7 @@
#include <boost/scope_exit.hpp>
#include <boost/preprocessor/cat.hpp>
-#define BOOST_TEST_MODULE TestSameLine
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
//[same_line
#define SCOPE_EXIT_INC_DEC(variable, offset) \
@@ -40,20 +39,22 @@
variable -= offset; \
};
-BOOST_AUTO_TEST_CASE(test_same_line) {
+int main(void) {
int x = 0, delta = 10;
{
SCOPE_EXIT_INC_DEC(x, delta) // Multiple scope exits on same line.
}
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
#ifndef BOOST_NO_LAMBDAS
{
SCOPE_EXIT_ALL_INC_DEC(x, delta) // Multiple scope exits on same line.
}
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
#endif // lambdas
+
+ return boost::report_errors();
}
//]
Modified: trunk/libs/scope_exit/test/same_line_seq.cpp
==============================================================================
--- trunk/libs/scope_exit/test/same_line_seq.cpp (original)
+++ trunk/libs/scope_exit/test/same_line_seq.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -9,8 +9,7 @@
#include <boost/scope_exit.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/config.hpp>
-#define BOOST_TEST_MODULE TestSameLineSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#define SCOPE_EXIT_INC_DEC(variable, offset) \
BOOST_SCOPE_EXIT_ID( \
@@ -35,19 +34,21 @@
variable -= offset; \
};
-BOOST_AUTO_TEST_CASE(test_same_line_seq) {
+int main(void) {
int x = 0, delta = 10;
{
SCOPE_EXIT_INC_DEC(x, delta)
}
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
#ifndef BOOST_NO_LAMBDAS
{
SCOPE_EXIT_ALL_INC_DEC(x, delta)
}
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
#endif // lambdas
+
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/tu_test.hpp
==============================================================================
--- trunk/libs/scope_exit/test/tu_test.hpp (original)
+++ trunk/libs/scope_exit/test/tu_test.hpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -6,6 +6,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+// No #include guard for this header.
+
#include <boost/scope_exit.hpp>
#include <boost/config.hpp>
Modified: trunk/libs/scope_exit/test/world.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world.cpp (original)
+++ trunk/libs/scope_exit/test/world.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -15,8 +15,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorld
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
struct person {};
@@ -47,11 +46,12 @@
}
//]
-BOOST_AUTO_TEST_CASE(test_world) {
+int main(void) {
world w;
person p;
w.add_person(p);
- BOOST_CHECK(w.population() == 1);
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
}
#endif // variadic macros
Modified: trunk/libs/scope_exit/test/world_checkpoint.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint.cpp (original)
+++ trunk/libs/scope_exit/test/world_checkpoint.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -16,8 +16,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpoint
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
#include <iostream>
#include <sstream>
@@ -86,17 +85,17 @@
}
//]
-BOOST_AUTO_TEST_CASE(test_world_checkpoint) {
+int main(void) {
person adam, eva;
std::ostringstream oss;
oss << adam;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
oss.str("");
oss << eva;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
world w;
w.add_person(adam);
@@ -104,7 +103,9 @@
oss.str("");
oss << w;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+
+ return boost::report_errors();
}
#endif // variadic macros
Modified: trunk/libs/scope_exit/test/world_checkpoint_all.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint_all.cpp (original)
+++ trunk/libs/scope_exit/test/world_checkpoint_all.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -18,8 +18,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpointAll
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
#include <iostream>
#include <sstream>
@@ -88,17 +87,17 @@
}
//]
-BOOST_AUTO_TEST_CASE(test_world_checkpoint_all) {
+int main(void) {
person adam, eva;
std::ostringstream oss;
oss << adam;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
oss.str("");
oss << eva;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
world w;
w.add_person(adam);
@@ -106,7 +105,9 @@
oss.str("");
oss << w;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+
+ return boost::report_errors();
}
#endif // lambda functions and variadic macros
Deleted: trunk/libs/scope_exit/test/world_checkpoint_all_nova.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint_all_nova.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
+++ (empty file)
@@ -1,10 +0,0 @@
-
-// Copyright (C) 2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/scope_exit
-
-#include "nova.hpp"
-#include "world_checkpoint_all_seq.cpp"
-
Modified: trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp (original)
+++ trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -16,8 +16,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpointAllSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
#include <iostream>
#include <sstream>
@@ -84,17 +83,17 @@
checkpoint = ++p.evolution;
}
-BOOST_AUTO_TEST_CASE(test_world_checkpoint_all_seq) {
+int main(void) {
person adam, eva;
std::ostringstream oss;
oss << adam;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
oss.str("");
oss << eva;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
world w;
w.add_person(adam);
@@ -102,7 +101,9 @@
oss.str("");
oss << w;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+
+ return boost::report_errors();
}
#endif // variadic macros
Modified: trunk/libs/scope_exit/test/world_checkpoint_seq.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint_seq.cpp (original)
+++ trunk/libs/scope_exit/test/world_checkpoint_seq.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -11,8 +11,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpointSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
#include <iostream>
#include <sstream>
@@ -79,17 +78,17 @@
checkpoint = ++p.evolution;
}
-BOOST_AUTO_TEST_CASE(test_world_checkpoint_seq) {
+int main(void) {
person adam, eva;
std::ostringstream oss;
oss << adam;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
oss.str("");
oss << eva;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "person(0, 0)");
+ BOOST_TEST(oss.str() == "person(0, 0)");
world w;
w.add_person(adam);
@@ -97,6 +96,8 @@
oss.str("");
oss << w;
std::cout << oss.str() << std::endl;
- BOOST_CHECK(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/world_seq.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_seq.cpp (original)
+++ trunk/libs/scope_exit/test/world_seq.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,8 +10,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
struct person {};
@@ -42,10 +41,11 @@
}
//]
-BOOST_AUTO_TEST_CASE(test_world_seq) {
+int main(void) {
world w;
person p;
w.add_person(p);
- BOOST_CHECK(w.population() == 1);
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/world_this.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_this.cpp (original)
+++ trunk/libs/scope_exit/test/world_this.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -15,8 +15,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldThis
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <boost/config.hpp>
#include <vector>
@@ -47,11 +46,12 @@
commit = true;
}
-BOOST_AUTO_TEST_CASE(test_world_this) {
+int main(void) {
world w;
person p;
w.add_person(p);
- BOOST_CHECK(w.population() == 1);
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
}
#endif // variadic macros
Modified: trunk/libs/scope_exit/test/world_this_seq.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_this_seq.cpp (original)
+++ trunk/libs/scope_exit/test/world_this_seq.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,8 +10,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldThisSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <boost/config.hpp>
#include <vector>
@@ -40,10 +39,11 @@
commit = true;
}
-BOOST_AUTO_TEST_CASE(test_world_this_seq) {
+int main(void) {
world w;
person p;
w.add_person(p);
- BOOST_CHECK(w.population() == 1);
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/world_tpl.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_tpl.cpp (original)
+++ trunk/libs/scope_exit/test/world_tpl.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -15,8 +15,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldTpl
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
struct person {};
@@ -48,11 +47,12 @@
}
//]
-BOOST_AUTO_TEST_CASE(test_world_tpl) {
+int main(void) {
world<person> w;
person p;
w.add_person(p);
- BOOST_CHECK(w.population() == 1);
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
}
#endif // variadic macros
Modified: trunk/libs/scope_exit/test/world_tpl_seq.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_tpl_seq.cpp (original)
+++ trunk/libs/scope_exit/test/world_tpl_seq.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,8 +10,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldTplSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
struct person {};
@@ -41,10 +40,11 @@
commit = true;
}
-BOOST_AUTO_TEST_CASE(test_world_tpl_seq) {
+int main(void) {
world<person> w;
person p;
w.add_person(p);
- BOOST_CHECK(w.population() == 1);
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
}
Modified: trunk/libs/scope_exit/test/world_void.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_void.cpp (original)
+++ trunk/libs/scope_exit/test/world_void.cpp 2012-03-31 09:27:36 EDT (Sat, 31 Mar 2012)
@@ -10,8 +10,7 @@
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldVoid
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <vector>
struct person {};
@@ -38,9 +37,10 @@
}
//]
-BOOST_AUTO_TEST_CASE( test_world_void ) {
+int main(void) {
person p;
add_person(p);
- BOOST_CHECK(world.persons.size() == 1);
+ BOOST_TEST(world.persons.size() == 1);
+ return boost::report_errors();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk