diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 26cd203..ba73852 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,18 +1,21 @@ -# Boost Exception Library test Jamfile +# Boost ThrowException Library test Jamfile # # Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. +# Copyright 2019 Peter Dimov # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import testing ; +project : requirements extra on ; + run throw_exception_test.cpp ; run throw_exception_no_exceptions_test.cpp ; run throw_exception_no_integration_test.cpp ; run throw_exception_no_both_test.cpp ; -compile-fail throw_exception_fail.cpp ; +compile-fail throw_exception_fail.cpp : -on ; run throw_exception_test2.cpp ; run throw_exception_test3.cpp ; diff --git a/test/throw_exception_no_both_test.cpp b/test/throw_exception_no_both_test.cpp index b7e673f..e87695a 100644 --- a/test/throw_exception_no_both_test.cpp +++ b/test/throw_exception_no_both_test.cpp @@ -9,6 +9,10 @@ #include #include +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif + class my_exception: public std::exception {}; int main() diff --git a/test/throw_exception_no_exceptions_test.cpp b/test/throw_exception_no_exceptions_test.cpp index 467dab5..8bfb95e 100644 --- a/test/throw_exception_no_exceptions_test.cpp +++ b/test/throw_exception_no_exceptions_test.cpp @@ -8,6 +8,10 @@ #include #include +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif + class my_exception: public std::exception {}; int main() diff --git a/test/throw_exception_no_integration_test.cpp b/test/throw_exception_no_integration_test.cpp index 6fa78f5..b2c499d 100644 --- a/test/throw_exception_no_integration_test.cpp +++ b/test/throw_exception_no_integration_test.cpp @@ -5,7 +5,11 @@ #define BOOST_EXCEPTION_DISABLE #include -#include +#include + +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif class my_exception: public std::exception { }; diff --git a/test/throw_exception_nx_test.cpp b/test/throw_exception_nx_test.cpp index 86957f8..f6ac515 100644 --- a/test/throw_exception_nx_test.cpp +++ b/test/throw_exception_nx_test.cpp @@ -2,6 +2,11 @@ // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +# pragma warning(disable: 4577) // noexcept used without /EHsc +#endif + #include #include diff --git a/test/throw_exception_nx_test2.cpp b/test/throw_exception_nx_test2.cpp index 4964f77..aabe380 100644 --- a/test/throw_exception_nx_test2.cpp +++ b/test/throw_exception_nx_test2.cpp @@ -2,6 +2,11 @@ // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +# pragma warning(disable: 4577) // noexcept used without /EHsc +#endif + #include #include #include @@ -22,7 +27,7 @@ void throw_exception( std::exception const &, boost::source_location const & loc int r = 0; if( std::strcmp( loc.file_name(), __FILE__ ) != 0 ) ++r; - if( loc.line() != 13 ) ++r; + if( loc.line() != 18 ) ++r; std::exit( r ); } diff --git a/test/throw_exception_test.cpp b/test/throw_exception_test.cpp index 5106e86..89031e8 100644 --- a/test/throw_exception_test.cpp +++ b/test/throw_exception_test.cpp @@ -4,10 +4,13 @@ //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include - +#include #include +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif + class my_exception: public std::exception { }; int diff --git a/test/throw_exception_test2.cpp b/test/throw_exception_test2.cpp index 30e6a37..0655a64 100644 --- a/test/throw_exception_test2.cpp +++ b/test/throw_exception_test2.cpp @@ -6,7 +6,11 @@ // http://www.boost.org/LICENSE_1_0.txt #include -#include +#include + +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif class my_exception: public std::exception { diff --git a/test/throw_exception_test3.cpp b/test/throw_exception_test3.cpp index 5a26f36..d130044 100644 --- a/test/throw_exception_test3.cpp +++ b/test/throw_exception_test3.cpp @@ -7,7 +7,11 @@ #include #include -#include +#include + +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif class my_exception: public std::exception { diff --git a/test/throw_from_library_test.cpp b/test/throw_from_library_test.cpp index 22a89da..a71709e 100644 --- a/test/throw_from_library_test.cpp +++ b/test/throw_from_library_test.cpp @@ -13,6 +13,10 @@ #include #include +#if defined(_MSC_VER) +# pragma warning(disable: 4702) // unreachable code +#endif + void test_catch_by_type() { BOOST_TEST_THROWS( lib1::f(), lib1::exception );