Hi Gennadiy, and welcome back!
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Gennadiy Rozental Sent: Saturday, June 06, 2009 12:02 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Boost.Test] BOOST_FAIL vs BOOST_ERROR
Greg Christopher wrote:
Why was it incorrect? Your test case indeed did not run any assertions. This warning you can ignore safely in your case.
Well, the message says "include any assertions" not "did not run any assertions".
Good point. I guess I can change the warning message.
However the bigger issue is: How do I grep the log to see if there was an aborted test run due to setup?
You can't have it both ways. Either you want your test case to be reported as aborted or as as passed.
There are three valid states- aborted, passed, or failed.
I guess I can look for this string "doesn't include any assertions". That seems like I'm doing it by side effect less than a more direct message that explains that the test case chose to quit because setup failed.
You can 2 options:
1. You can fail some REQUIRE level check and thus abort the test case. 2. You can detect that the test case did not run any assertions as a condition that it was aborted by fixture setup
Right. And the log does show differently.. but the message "doesn't include any assertions" is more like a canary that setup failed. It's fine- still usable. I like your suggestion to parse the xml. I will begin looking at XML output- thanks! Greg