diff --git a/include/boost/core/lightweight_test.hpp b/include/boost/core/lightweight_test.hpp index 83f20bc..c09ce87 100644 --- a/include/boost/core/lightweight_test.hpp +++ b/include/boost/core/lightweight_test.hpp @@ -42,7 +42,6 @@ namespace boost { - namespace detail { @@ -519,6 +518,15 @@ inline int report_errors() return errors < 256? errors: 255; } +namespace core +{ + +inline void lwt_init() +{ + boost::detail::test_results(); +} + +} // namespace core } // namespace boost #define BOOST_TEST(expr) ( ::boost::detail::test_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (expr)? true: false) ) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index bf44f47..ffe7b4d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -148,6 +148,7 @@ run-fail lightweight_test_fail12.cpp ; run-fail lightweight_test_fail13.cpp ; run-fail lightweight_test_fail14.cpp ; run-fail lightweight_test_fail15.cpp ; +run-fail lightweight_test_fail16.cpp ; run-fail lightweight_test_lt_fail.cpp ; run-fail lightweight_test_le_fail.cpp ; run-fail lightweight_test_gt_fail.cpp ; diff --git a/test/lightweight_test_fail16.cpp b/test/lightweight_test_fail16.cpp new file mode 100644 index 0000000..dbeb3c0 --- /dev/null +++ b/test/lightweight_test_fail16.cpp @@ -0,0 +1,12 @@ +// Copyright 2022 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include + +// Should fail, because boost::report_errors() hasn't been called + +int main() +{ + boost::core::lwt_init(); +}