Hey everyone, I can make BOOST_CHECK produce a failure message like this: BOOST_AUTO_TEST_CASE( test_case2 ) { BOOST_CHECK( 1+1 == 3 ); } But when I try BOOST_WARN, all tests pass: BOOST_AUTO_TEST_CASE( test_case3 ) { BOOST_WARN( 1+1 == 3 ); } Running 3 test cases... *** No errors detected Perhaps I'm doing something wrong. Can someone point me in the right direction? Both BOOST_REQUIRE and BOOST_CHECK work OK. It's only BOOST_WARN that does not work for my testing. Thanks, Brad
My understanding is that WARN is working the way it's supposed to--it
just warns you that something doesn't match, but a warning by itself
doesn't cause something to be flagged as a failure. If you want a
failure, use CHECK or REQUIRE (depending on whether you want further
checks to be made or for testing to stop immediately).
On Mon, Jan 9, 2012 at 12:21 PM, Brad Tilley
Hey everyone,
I can make BOOST_CHECK produce a failure message like this:
BOOST_AUTO_TEST_CASE( test_case2 ) { BOOST_CHECK( 1+1 == 3 ); }
But when I try BOOST_WARN, all tests pass:
BOOST_AUTO_TEST_CASE( test_case3 ) { BOOST_WARN( 1+1 == 3 ); }
Running 3 test cases...
*** No errors detected
Perhaps I'm doing something wrong. Can someone point me in the right direction? Both BOOST_REQUIRE and BOOST_CHECK work OK. It's only BOOST_WARN that does not work for my testing.
Thanks,
Brad _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Chris Cleeland
On Mon, Jan 9, 2012 at 7:21 PM, Brad Tilley
Hey everyone,
I can make BOOST_CHECK produce a failure message like this:
BOOST_AUTO_TEST_CASE( test_case2 ) { BOOST_CHECK( 1+1 == 3 ); }
But when I try BOOST_WARN, all tests pass:
BOOST_AUTO_TEST_CASE( test_case3 ) { BOOST_WARN( 1+1 == 3 ); }
Running 3 test cases...
*** No errors detected
Perhaps I'm doing something wrong. Can someone point me in the right direction? Both BOOST_REQUIRE and BOOST_CHECK work OK. It's only BOOST_WARN that does not work for my testing.
Please take a look to the link below regarding testing tools and their relation to the error counter and test execution: http://www.boost.org/doc/libs/1_46_1/libs/test/doc/html/utf/testing-tools.ht... With Kind Regards, Ovanes
Please take a look to the link below regarding testing tools and their relation to the error counter and test execution:http://www.boost.org/doc/libs/1_46_1/libs/test/doc/html/utf/testing-t...
With Kind Regards, Ovanes
Thanks guys! I expected WARN to behave differently. I appreciate the advice. Brad
Please take a look to the link below regarding testing tools and their relation to the error counter and test execution:http://www.boost.org/doc/libs/1_46_1/libs/test/doc/html/utf/testing-t...
With Kind Regards, Ovanes
Perhaps it's just me, but I cannot make BOOST_WARN issue a warning. It's silent no matter how I use it BOOST_WARN( 1+1 == 3 ) does not issue a warning. Is that expected, does something have to be tweaked to show warning messages? Both BOOST_CHECK and BOOST_REQUIRE work as expected.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Brad Tilley Sent: Tuesday, January 10, 2012 1:44 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Quick Unit Test Question
Please take a look to the link below regarding testing tools and their relation to the error counter and test execution:http://www.boost.org/doc/libs/1_46_1/libs/test/doc/html/utf/testing-t...
With Kind Regards, Ovanes
Perhaps it's just me, but I cannot make BOOST_WARN issue a warning. It's silent no matter how I use it BOOST_WARN( 1+1 == 3 ) does not issue a warning. Is that expected, does something have to be tweaked to show warning messages?
Both BOOST_CHECK and BOOST_REQUIRE work as expected.
I suspect you have fallen foul of the log levels (been there, done that - with messages!) http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/utf/user-guide/runti... Do you need --log_level=warning? HTH Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
Thank you Paul! Running my test like this: ./test --log_level=all Does indeed show warning messages. Thanks again, Brad
I suspect you have fallen foul of the log levels (been there, done that - with messages!)
http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/utf/user-guid...
Do you need --log_level=warning?
HTH
Paul
--- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbris...@hetp.u-net.com
_______________________________________________ Boost-users mailing list Boost-us...@lists.boost.orghttp://lists.boost.org/mailman/listinfo.cgi/boost-users
[Please do not mail me a copy of your followup] You may find my 5-part tutorial on C++ unit testing with Boost.Test helpful: http://legalizeadulthood.wordpress.com/2009/07/04/c-unit-tests-with-boost-te... -- "The Direct3D Graphics Pipeline" -- DirectX 9 version available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
participants (5)
-
Brad Tilley
-
Chris Cleeland
-
legalize+jeeves@mail.xmission.com
-
Ovanes Markarian
-
Paul A. Bristow