
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Gennadiy Rozental Sent: Thursday, May 14, 2009 2:15 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Boost.Test] BOOST_FAIL vs BOOST_ERROR
Greg Christopher
writes: BOOST_REQUIRE won't work in the setup step because it does exactly what I want to avoid :) Thanks, I will throw a c++ exception.
Actually C++ exception will lead to the same result - test case being marked as failed.
If I understand what you need correctly, you need to throw boost::execution_aborted(). This exception is treated specially by execution monitor and no error is reported.
As it turns out this throws off the monitor. If my setup step throws this, boost test thinks that my test was ill defined (no assertions): Entering test case "TEST_2" Test case TEST_2 doesn't include any assertions Leaving test case "TEST_2" Leaving test suite "BasicTest" Leaving test suite "BasicTest" If I don't abort the setup, this executes all the test cases and doesn't say it doesn't include any assertions. I suppose the error message is harmless, but incorrect. Greg