How to get BOOST_TEST_MESSAGE to display on the screen?

I make my way through the Boost Unit testing platform and set up the basic unit test. I use BOOST_TEST_MESSAGE so that the user knows which tests are running, but the messages do not appear on the screen. For example:

 #define BOOST_TEST_MODULE MyTest #include <boost/test/included/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(MyTestSuite, MyTestFixture) BOOST_AUTO_TEST_CASE(MessageTest) { BOOST_TEST_MESSAGE( "no one sees this!" ); } BOOST_AUTO_TEST_SUITE_END(); 

I tried to define BOOST_TEST_LOG_LEVEL - all , but this has no effect. I got this idea on the Boost log-level page, but I think that the concept of the log cannot be related to what is actually displayed on the screen. Any ideas?

+9
c ++ boost
source share
1 answer

According to the documentation :

Messages generated by this tool are not displayed in the test output bin with the default value for the active log level threshold. For these messages to appear, the active log level threshold must be set to a value lower than or equal to "message".

Or set the BOOST_TEST_LOG_LEVEL environment BOOST_TEST_LOG_LEVEL to message when running the test binary:

 BOOST_TEST_LOG_LEVEL=message <your_test> 

or pass a command line argument --log_level :

 <your_test> --log_level=message 
+12
source share

All Articles