diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4412cbc..eb6be32 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -6,55 +6,53 @@ # See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt -# bring in rules for testing import testing ; -test-suite "core" - : - [ run addressof_test.cpp ] - [ run addressof_test2.cpp ] - [ run addressof_np_test.cpp ] - [ run addressof_fn_test.cpp ] +run addressof_test.cpp ; +run addressof_test2.cpp ; +run addressof_np_test.cpp ; +run addressof_fn_test.cpp ; - [ run checked_delete_test.cpp ] - [ compile-fail checked_delete_fail.cpp ] - [ compile-fail checked_delete_fail2.cpp ] +run checked_delete_test.cpp ; +compile-fail checked_delete_fail.cpp ; +compile-fail checked_delete_fail2.cpp ; - [ compile ref_ct_test.cpp ] - [ run ref_test.cpp ] +compile ref_ct_test.cpp ; +run ref_test.cpp ; - [ run eif_constructors.cpp ] - [ run eif_dummy_arg_disambiguation.cpp ] - [ run eif_lazy.cpp ] - [ run eif_lazy_test.cpp ] - [ run eif_member_templates.cpp ] - [ run eif_namespace_disambiguation.cpp ] - [ run eif_no_disambiguation.cpp ] - [ run eif_partial_specializations.cpp ] +run eif_constructors.cpp ; +run eif_dummy_arg_disambiguation.cpp ; +run eif_lazy.cpp ; +run eif_lazy_test.cpp ; +run eif_member_templates.cpp ; +run eif_namespace_disambiguation.cpp ; +run eif_no_disambiguation.cpp ; +run eif_partial_specializations.cpp ; - [ run explicit_operator_bool.cpp ] - [ run explicit_operator_bool_noexcept.cpp ] - [ compile-fail explicit_operator_bool_compile_fail_conv_int.cpp ] - [ compile-fail explicit_operator_bool_compile_fail_conv_pvoid.cpp ] - [ compile-fail explicit_operator_bool_compile_fail_delete.cpp ] - [ compile-fail explicit_operator_bool_compile_fail_shift.cpp ] +run explicit_operator_bool.cpp ; +run explicit_operator_bool_noexcept.cpp ; +compile-fail explicit_operator_bool_compile_fail_conv_int.cpp ; +compile-fail explicit_operator_bool_compile_fail_conv_pvoid.cpp ; +compile-fail explicit_operator_bool_compile_fail_delete.cpp ; +compile-fail explicit_operator_bool_compile_fail_shift.cpp ; - [ compile ignore_unused_test.cpp : gcc-4.8:"-Wunused-variable -Wunused-local-typedefs -Werror" - gcc:"-Wunused-variable -Werror" - clang:"-Wunused-variable -Werror" - msvc:"/we4100 /we4101" ] - [ run sp_typeinfo_test.cpp ] - [ run sp_typeinfo_test.cpp : : : off : sp_typeinfo_test_no_rtti ] +compile ignore_unused_test.cpp : gcc-4.8:"-Wunused-variable -Wunused-local-typedefs -Werror" + gcc:"-Wunused-variable -Werror" + clang:"-Wunused-variable -Werror" + msvc:"/we4100 /we4101" ; +run sp_typeinfo_test.cpp ; +run sp_typeinfo_test.cpp : : : off : sp_typeinfo_test_no_rtti ; - [ run visit_each_test.cpp ] +run visit_each_test.cpp ; - [ run get_pointer_test.cpp ] +run get_pointer_test.cpp ; - [ run lightweight_test_test.cpp ] - [ run-fail lightweight_test_fail.cpp ] - [ run-fail lightweight_test_fail2.cpp ] - [ run-fail lightweight_test_fail3.cpp ] - [ run-fail lightweight_test_fail4.cpp ] - [ run-fail lightweight_test_fail5.cpp ] - [ run-fail lightweight_test_fail6.cpp ] - ; +run lightweight_test_test.cpp ; +run lightweight_test_test.cpp : : : off : lightweight_test_test_no_except ; + +run-fail lightweight_test_fail.cpp ; +run-fail lightweight_test_fail2.cpp ; +run-fail lightweight_test_fail3.cpp ; +run-fail lightweight_test_fail4.cpp ; +run-fail lightweight_test_fail5.cpp ; +run-fail lightweight_test_fail6.cpp ; diff --git a/test/lightweight_test_test.cpp b/test/lightweight_test_test.cpp index 475371c..7847ad1 100644 --- a/test/lightweight_test_test.cpp +++ b/test/lightweight_test_test.cpp @@ -14,15 +14,21 @@ struct X { }; +#if !defined( BOOST_NO_EXCEPTIONS ) +# define LWT_THROW( x ) throw x +#else +# define LWT_THROW( x ) ((void)(x)) +#endif + void f( bool x ) { if( x ) { - throw X(); + LWT_THROW( X() ); } else { - throw 5; + LWT_THROW( 5 ); } }