Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] BOOST_FAIL vs BOOST_ERROR
From: Greg Christopher (gchristopher_at_[hidden])
Date: 2009-05-21 19:49:57


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
> Sent: Thursday, May 14, 2009 2:15 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [Boost.Test] BOOST_FAIL vs BOOST_ERROR
>
> Greg Christopher <gchristopher <at> vmware.com> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net