diff --git a/test/swap/Jamfile.v2 b/test/swap/Jamfile.v2 index ccf44e0..8384c93 100644 --- a/test/swap/Jamfile.v2 +++ b/test/swap/Jamfile.v2 @@ -52,7 +52,7 @@ rule test_all for file in $(run_tests) { local test_name = [ MATCH "([^.]*).cpp$" : $(file) ] ; - all_rules += [ run $(file) ../../../test/build//boost_test_exec_monitor/static : : : : "swap-$(test_name)" ] ; + all_rules += [ run $(file) : : : : "swap-$(test_name)" ] ; } #ECHO All rules: $(all_rules) ; diff --git a/test/swap/array_of_array_of_class.cpp b/test/swap/array_of_array_of_class.cpp index 4f02578..67541d3 100644 --- a/test/swap/array_of_array_of_class.cpp +++ b/test/swap/array_of_array_of_class.cpp @@ -7,8 +7,9 @@ // Tests swapping an array of arrays of swap_test_class objects by means of boost::swap. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in the global namespace #include "./swap_test_class.hpp" @@ -36,7 +37,7 @@ namespace std } -int test_main(int, char*[]) +int main() { const std::size_t first_dimension = 3; const std::size_t second_dimension = 4; @@ -65,5 +66,5 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class::swap_count(), number_of_elements); BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/array_of_array_of_int.cpp b/test/swap/array_of_array_of_int.cpp index c1778ec..3f9b239 100644 --- a/test/swap/array_of_array_of_int.cpp +++ b/test/swap/array_of_array_of_int.cpp @@ -7,13 +7,14 @@ // Tests swapping an array of arrays of integers by means of boost::swap. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include //for std::copy and std::equal #include //for std::size_t -int test_main(int, char*[]) +int main() { const std::size_t first_dimension = 3; const std::size_t second_dimension = 4; @@ -38,5 +39,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(ptr1[i], static_cast(i + number_of_elements) ); BOOST_CHECK_EQUAL(ptr2[i], static_cast(i) ); } - return 0; + + return boost::report_errors(); } diff --git a/test/swap/array_of_class.cpp b/test/swap/array_of_class.cpp index 356762d..ef7327e 100644 --- a/test/swap/array_of_class.cpp +++ b/test/swap/array_of_class.cpp @@ -7,8 +7,9 @@ // Tests swapping an array of arrays of swap_test_class objects by means of boost::swap. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in the global namespace #include "./swap_test_class.hpp" @@ -36,7 +37,7 @@ namespace std } -int test_main(int, char*[]) +int main() { const std::size_t array_size = 2; const swap_test_class initial_array1[array_size] = { swap_test_class(1), swap_test_class(2) }; @@ -57,5 +58,5 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class::swap_count(), array_size); BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/array_of_int.cpp b/test/swap/array_of_int.cpp index 22a7dde..e8285e0 100644 --- a/test/swap/array_of_int.cpp +++ b/test/swap/array_of_int.cpp @@ -7,14 +7,15 @@ // Tests swapping an array of integers by means of boost::swap. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include //for std::copy and std::equal #include //for std::size_t -int test_main(int, char*[]) +int main() { const std::size_t array_size = 3; const int initial_array1[array_size] = { 1, 2, 3 }; @@ -31,5 +32,5 @@ int test_main(int, char*[]) BOOST_CHECK(std::equal(array1, array1 + array_size, initial_array2)); BOOST_CHECK(std::equal(array2, array2 + array_size, initial_array1)); - return 0; + return boost::report_errors(); } diff --git a/test/swap/array_of_template.cpp b/test/swap/array_of_template.cpp index 8f350ad..c0e76e3 100644 --- a/test/swap/array_of_template.cpp +++ b/test/swap/array_of_template.cpp @@ -7,8 +7,9 @@ // Tests swapping an array of swap_test_template objects by means of boost::swap. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in the global namespace #include "./swap_test_class.hpp" @@ -46,7 +47,7 @@ void swap(swap_test_template& left, swap_test_template& right) } -int test_main(int, char*[]) +int main() { const std::size_t array_size = 2; const swap_test_template initial_array1[array_size] = { swap_test_class(1), swap_test_class(2) }; @@ -67,5 +68,5 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class::swap_count(), array_size); BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/no_ambiguity_in_boost.cpp b/test/swap/no_ambiguity_in_boost.cpp index e269252..795ffe3 100644 --- a/test/swap/no_ambiguity_in_boost.cpp +++ b/test/swap/no_ambiguity_in_boost.cpp @@ -13,8 +13,9 @@ // than std::swap. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in namespace boost namespace boost @@ -23,7 +24,7 @@ namespace boost } -int test_main(int, char*[]) +int main() { const boost::swap_test_class initial_value1(1); const boost::swap_test_class initial_value2(2); @@ -39,6 +40,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(boost::swap_test_class::swap_count(),0); BOOST_CHECK_EQUAL(boost::swap_test_class::copy_count(),3); - return 0; + return boost::report_errors(); } diff --git a/test/swap/primitive.cpp b/test/swap/primitive.cpp index 380edb3..a996f01 100644 --- a/test/swap/primitive.cpp +++ b/test/swap/primitive.cpp @@ -5,10 +5,11 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ -int test_main(int, char*[]) +int main() { int object1 = 1; int object2 = 2; @@ -18,6 +19,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(object1,2); BOOST_CHECK_EQUAL(object2,1); - return 0; + return boost::report_errors(); } diff --git a/test/swap/specialized_in_boost.cpp b/test/swap/specialized_in_boost.cpp index 7b3e12e..dcb015d 100644 --- a/test/swap/specialized_in_boost.cpp +++ b/test/swap/specialized_in_boost.cpp @@ -5,8 +5,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in namespace boost namespace boost @@ -23,7 +24,7 @@ namespace boost } } -int test_main(int, char*[]) +int main() { const boost::swap_test_class initial_value1(1); const boost::swap_test_class initial_value2(2); @@ -40,6 +41,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(boost::swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(boost::swap_test_class::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/specialized_in_boost_and_other.cpp b/test/swap/specialized_in_boost_and_other.cpp index ba6247f..d596775 100644 --- a/test/swap/specialized_in_boost_and_other.cpp +++ b/test/swap/specialized_in_boost_and_other.cpp @@ -15,8 +15,9 @@ // to the boost namespace. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in namespace other namespace other @@ -42,7 +43,7 @@ namespace other } } -int test_main(int, char*[]) +int main() { const other::swap_test_class initial_value1(1); const other::swap_test_class initial_value2(2); @@ -59,6 +60,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/specialized_in_global.cpp b/test/swap/specialized_in_global.cpp index 0a0a029..8b0f10a 100644 --- a/test/swap/specialized_in_global.cpp +++ b/test/swap/specialized_in_global.cpp @@ -5,8 +5,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in the global namespace #include "./swap_test_class.hpp" @@ -17,7 +18,7 @@ void swap(swap_test_class& left, swap_test_class& right) left.swap(right); } -int test_main(int, char*[]) +int main() { const swap_test_class initial_value1(1); const swap_test_class initial_value2(2); @@ -34,6 +35,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/specialized_in_other.cpp b/test/swap/specialized_in_other.cpp index a39896f..016cc8a 100644 --- a/test/swap/specialized_in_other.cpp +++ b/test/swap/specialized_in_other.cpp @@ -5,8 +5,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in namespace other namespace other @@ -23,7 +24,7 @@ namespace other } } -int test_main(int, char*[]) +int main() { const other::swap_test_class initial_value1(1); const other::swap_test_class initial_value2(2); @@ -40,6 +41,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/specialized_in_std.cpp b/test/swap/specialized_in_std.cpp index e31e850..62d4ee4 100644 --- a/test/swap/specialized_in_std.cpp +++ b/test/swap/specialized_in_std.cpp @@ -5,8 +5,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in the global namespace #include "./swap_test_class.hpp" @@ -22,7 +23,7 @@ namespace std } } -int test_main(int, char*[]) +int main() { const swap_test_class initial_value1(1); const swap_test_class initial_value2(2); @@ -39,6 +40,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_bitset.cpp b/test/swap/std_bitset.cpp index c46b686..6fc3ecb 100644 --- a/test/swap/std_bitset.cpp +++ b/test/swap/std_bitset.cpp @@ -9,12 +9,13 @@ // std::bitset does not have its own std::swap overload. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include -int test_main(int, char*[]) +int main() { typedef std::bitset<8> bitset_type; const bitset_type initial_value1 = 1; @@ -28,6 +29,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(object1,initial_value2); BOOST_CHECK_EQUAL(object2,initial_value1); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_dateorder.cpp b/test/swap/std_dateorder.cpp index b593f6f..7f6df73 100644 --- a/test/swap/std_dateorder.cpp +++ b/test/swap/std_dateorder.cpp @@ -9,12 +9,13 @@ // std::swap overload or template specialization. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include -int test_main(int, char*[]) +int main() { const std::time_base::dateorder initial_value1 = std::time_base::dmy; const std::time_base::dateorder initial_value2 = std::time_base::mdy; @@ -27,6 +28,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(object1,initial_value2); BOOST_CHECK_EQUAL(object2,initial_value1); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_string.cpp b/test/swap/std_string.cpp index b7d3d4d..128f3b5 100644 --- a/test/swap/std_string.cpp +++ b/test/swap/std_string.cpp @@ -8,12 +8,13 @@ // std::string has its own std::swap overload. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include -int test_main(int, char*[]) +int main() { const std::string initial_value1 = "one"; const std::string initial_value2 = "two"; @@ -26,6 +27,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(object1,initial_value2); BOOST_CHECK_EQUAL(object2,initial_value1); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_typeinfo_ptr.cpp b/test/swap/std_typeinfo_ptr.cpp index 38e293a..10fd6e5 100644 --- a/test/swap/std_typeinfo_ptr.cpp +++ b/test/swap/std_typeinfo_ptr.cpp @@ -9,12 +9,13 @@ // for std::type_info pointers. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include -int test_main(int, char*[]) +int main() { const std::type_info * const initial_value1 = 0; const std::type_info * const initial_value2 = &typeid(double); @@ -27,6 +28,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(ptr1,initial_value2); BOOST_CHECK_EQUAL(ptr2,initial_value1); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_vector_of_boost.cpp b/test/swap/std_vector_of_boost.cpp index b0c6355..93d5d61 100644 --- a/test/swap/std_vector_of_boost.cpp +++ b/test/swap/std_vector_of_boost.cpp @@ -8,8 +8,9 @@ // having boost::swap_test_class as vector element type. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include @@ -28,7 +29,7 @@ namespace boost } } -int test_main(int, char*[]) +int main() { typedef boost::swap_test_class swap_test_class_type; typedef std::vector vector_type; @@ -55,6 +56,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class_type::swap_count(),0); BOOST_CHECK_EQUAL(swap_test_class_type::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_vector_of_global.cpp b/test/swap/std_vector_of_global.cpp index 96a9b6a..08d6974 100644 --- a/test/swap/std_vector_of_global.cpp +++ b/test/swap/std_vector_of_global.cpp @@ -8,8 +8,9 @@ // having ::swap_test_class as vector element type. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include @@ -22,7 +23,7 @@ void swap(swap_test_class& left, swap_test_class& right) left.swap(right); } -int test_main(int, char*[]) +int main() { typedef std::vector vector_type; @@ -48,6 +49,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class::swap_count(),0); BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0); - return 0; + return boost::report_errors(); } diff --git a/test/swap/std_vector_of_other.cpp b/test/swap/std_vector_of_other.cpp index 2176f6e..77a3525 100644 --- a/test/swap/std_vector_of_other.cpp +++ b/test/swap/std_vector_of_other.cpp @@ -8,8 +8,9 @@ // having other::swap_test_class as vector element type. #include -#define BOOST_INCLUDE_MAIN -#include +#include +#define BOOST_CHECK BOOST_TEST +#define BOOST_CHECK_EQUAL BOOST_TEST_EQ #include @@ -28,7 +29,7 @@ namespace other } } -int test_main(int, char*[]) +int main() { typedef other::swap_test_class swap_test_class_type; typedef std::vector vector_type; @@ -55,6 +56,6 @@ int test_main(int, char*[]) BOOST_CHECK_EQUAL(swap_test_class_type::swap_count(),0); BOOST_CHECK_EQUAL(swap_test_class_type::copy_count(),0); - return 0; + return boost::report_errors(); }