Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2024. The current version is 1.89.0.
The select at compile time the log format from the list of the formats supplied by the Unit Test Framework
boost::unit_test::unit_test_log.set_format( boost::unit_test::output_format );
or for adding a format:
boost::unit_test::unit_test_log.add_format( boost::unit_test::output_format );
![]() |
Caution |
|---|---|
|
![]() |
Tip |
|---|---|
See |
In regular circumstances you shouldn't use this interface. Prefer to use
runtime parameters --log_format
or --logger
for predefined log format selection.
|
Code |
|---|
#define BOOST_TEST_MODULE example #include <boost/test/included/unit_test.hpp> using namespace boost::unit_test; struct MyConfig { MyConfig() { unit_test_log.set_format( OF_XML ); } ~MyConfig() {} }; BOOST_TEST_GLOBAL_CONFIGURATION( MyConfig ); BOOST_AUTO_TEST_CASE( test_case0 ) { BOOST_TEST( false ); } |
|
Output |
|---|
> example --report_level=no <TestLog><Error file="test.cpp" line="23">check false failed</Error></TestLog> |