Skip to content

Commit

Permalink
Merge pull request #433 from boostorg/develop
Browse files Browse the repository at this point in the history
Merge to Master for 1.87
  • Loading branch information
mborland authored Nov 5, 2024
2 parents 4161c7b + aeeb091 commit fd631aa
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
4 changes: 4 additions & 0 deletions example/unit_test_example_16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ bool init_unit_test()
#if (!defined(BOOST_TEST_DYN_LINK) || (!defined(BOOST_CLANG) || (BOOST_CLANG != 1) || (__clang_major__ >= 8))) && !defined(__APPLE__)
log_level logLevel = runtime_config::get<log_level>(runtime_config::btrt_log_level);
std::cout << "Current log level: " << static_cast<int>(logLevel) << std::endl;
output_format logFormat = runtime_config::get<output_format>(runtime_config::btrt_log_format);
std::cout << "Current log format: " << static_cast<int>(logFormat) << std::endl;
report_level reportLevel = runtime_config::get<report_level>(runtime_config::btrt_report_level);
std::cout << "Current report level: " << static_cast<int>(reportLevel) << std::endl;
#endif
return true;
}
Expand Down
18 changes: 11 additions & 7 deletions include/boost/test/detail/global_typedef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ typedef unsigned long counter_t;

//____________________________________________________________________________//

enum report_level { INV_REPORT_LEVEL, CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT };
enum BOOST_SYMBOL_VISIBLE report_level { INV_REPORT_LEVEL,
CONFIRMATION_REPORT,
SHORT_REPORT,
DETAILED_REPORT,
NO_REPORT };

//____________________________________________________________________________//

//! Indicates the output format for the loggers or the test tree printing
enum output_format { OF_INVALID,
OF_CLF, ///< compiler log format
OF_XML, ///< XML format for report and log,
OF_JUNIT, ///< JUNIT format for report and log,
OF_CUSTOM_LOGGER, ///< User specified logger.
OF_DOT ///< dot format for output content
enum BOOST_SYMBOL_VISIBLE output_format { OF_INVALID,
OF_CLF, ///< compiler log format
OF_XML, ///< XML format for report and log,
OF_JUNIT, ///< JUNIT format for report and log,
OF_CUSTOM_LOGGER, ///< User specified logger.
OF_DOT ///< dot format for output content
};

//____________________________________________________________________________//
Expand Down
2 changes: 0 additions & 2 deletions include/boost/test/tools/detail/fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class assertion_result;

namespace tt_detail {

inline bool dummy_cond() { return false; }

// ************************************************************************** //
// ************** types of supported assertions ************** //
// ************************************************************************** //
Expand Down
14 changes: 7 additions & 7 deletions include/boost/test/tools/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ do { \
::boost::test_tools::tt_detail::level, \
::boost::test_tools::tt_detail::CHECK_MSG, \
0 ); \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

//____________________________________________________________________________//
Expand All @@ -74,7 +74,7 @@ do { \
::boost::test_tools::tt_detail::level, \
::boost::test_tools::tt_detail::CHECK_BUILT_ASSERTION, \
0 ); \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

//____________________________________________________________________________//
Expand All @@ -98,7 +98,7 @@ do { \
::boost::test_tools::tt_detail::assertion_type() \
<< arg, \
0 ); \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

//____________________________________________________________________________//
Expand All @@ -121,7 +121,7 @@ do { \
BOOST_TEST_TOOL_DIRECT_IMPL( P, level, BOOST_TEST_STRINGIZE( P ) ); \
else \
BOOST_TEST_TOOL_ET_IMPL( P, level ); \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

#define BOOST_TEST_TOOL_UNIV_EX( level, P, ... ) \
Expand Down Expand Up @@ -177,7 +177,7 @@ do { try { \
BOOST_TEST_TOOL_DIRECT_IMPL( Ppassed, TL, Mpassed ); \
} catch( E ) { \
BOOST_TEST_TOOL_DIRECT_IMPL( Pcaught, TL, Mcaught ); \
}} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
}} while( 0 ) \
/**/

#elif defined(BOOST_TEST_TOOLS_DEBUGGABLE)
Expand All @@ -190,7 +190,7 @@ do { try { \
BOOST_TEST_TOOL_DIRECT_IMPL( Ppassed, TL, Mpassed ); \
} catch( E ) { \
BOOST_TEST_TOOL_DIRECT_IMPL( Pcaught, TL, Mcaught ); \
}} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
}} while( 0 ) \
/**/

#else
Expand All @@ -202,7 +202,7 @@ do { try { \
BOOST_TEST_TOOL_DIRECT_IMPL( Ppassed, TL, Mpassed ); \
} catch( E ) { \
BOOST_TEST_TOOL_DIRECT_IMPL( Pcaught, TL, Mcaught ); \
}} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
}} while( 0 ) \
/**/

#endif
Expand Down
6 changes: 3 additions & 3 deletions include/boost/test/tools/old/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ do {
::boost::test_tools::tt_detail::TL, \
::boost::test_tools::tt_detail::CT \
BOOST_JOIN( BOOST_TEST_TOOL_PASS_ARGS, frwd_type )( ARGS ) ); \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

//____________________________________________________________________________//
Expand Down Expand Up @@ -110,7 +110,7 @@ do {
"exception \"" BOOST_STRINGIZE( E )"\" raised as expected" postfix, \
TL, CHECK_MSG, _ ); \
} \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

//____________________________________________________________________________//
Expand Down Expand Up @@ -140,7 +140,7 @@ do {
BOOST_TEST_TOOL_IMPL( 2, false, "unexpected exception thrown by " BOOST_STRINGIZE( S ), \
TL, CHECK_MSG, _ ); \
} \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
} while( 0 ) \
/**/

#define BOOST_WARN_NO_THROW( S ) BOOST_CHECK_NO_THROW_IMPL( S, WARN )
Expand Down

0 comments on commit fd631aa

Please sign in to comment.