Add boost::core::lwt_init()

This commit is contained in:
Peter Dimov 2022-12-30 21:17:58 +02:00
parent 843e0f7bb0
commit 6299da9273
3 changed files with 22 additions and 1 deletions

View File

@ -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) )

View File

@ -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 ;

View File

@ -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 <boost/core/lightweight_test.hpp>
// Should fail, because boost::report_errors() hasn't been called
int main()
{
boost::core::lwt_init();
}