[BOOST.TEST] [BOOST.WARN] Output weirdness

Hi, I am new to Boost.Test so not sure if this is expected behaviour or not. Based on this minimal test: |----------------------------8←------------------------------------| #include <boost/test/unit_test.hpp> using boost::unit_test::test_suite; // most frequently you implement test cases as a free functions void my_test() { int i=2; BOOST_WARN( sizeof(int) == sizeof(short) ); BOOST_CHECK( i == 1 ); BOOST_REQUIRE( i > 5 ); BOOST_CHECK( i == 6 ); // will never reach this check } test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test= BOOST_TEST_SUITE( " Test Suite!" ); // this example will pass cause we know ahead of time number of expected failures test->add( BOOST_TEST_CASE( & my_test ), 0 /* expected one error */ ); return test; } |----------------------------8←------------------------------------| Taken from this url: http://tinyurl.com/t54th (Click on BOOST_WARN). I expect to see this output (as mentioned at the above link): c:/development/code/practice/ test/mytest.cpp (14) : warning in test_main: condition sizeof(int) == sizeof(short) is not satisfied c:/development/code/practice/ test/mytest.cpp (15) : error in test_main: test i==1 failed c:/development/code/practice/ test/mytest.cpp (16) : fatal error in test_main: test i>5 failed But I see this output Running 1 test case... c:/development/code/practice/ test/mytest.cpp(15): error in " my_test ": check i == 1 failed c:/development/code/practice/ test/mytest.cpp (16): fatal error in " my_test ": critical check i > 5 failed *** 2 failures detected (2 failures expected) in test suite "Master Test Suite" It seems that the BOOST_WARN is not outputting a message. Is this expected behaviour? Also another minor point in the code I have named the BOOST_TEST_SUITE “Test Suite!” but in the output it is calling it “Master Test Suite”. Is this something I am not setting right? Thanks, Peter.

"Peter" <pjfoley@bigpond.com> wrote in message news:000701c7322d$04f85850$1100a8c0@Billswan.local... [...]
It seems that the BOOST_WARN is not outputting a message. Is this expected behaviour?
Yes. To see warnings you need to modify log level. By default only errors are reported. To see warnings you could specify command line argument --log_level=warning
Also another minor point in the code I have named the BOOST_TEST_SUITE "Test Suite!" but in the output it is calling it "Master Test Suite". Is this something I am not setting right?
Since 1.34.0. the master test suite is always present. This is test suite all other test cases and test suites (including automatically registered) are being added to. Check an examples to see how to specify the master test suite name using both auto-facility and explicit test module init. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Peter