Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] BOOST_FAIL vs BOOST_ERROR
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-05-14 12:56:39

Greg Christopher <gchristopher <at>> writes:

> This is true- we can use warn to mean aborting test although
> it seems to go against what most "first readers"
> of the code would think it is.

warning by itself does not cause test case to abort.
> This actually has raised another question for me. I am looking at fixtures.
> I would like to abort if the setup step fails.
> Unfortunately, setup is a constructor. I take it that means to
> abort if setup fails, I need to throw?


> Is there a specific exception I can throw to make it abort the current
> test case vs abort the test framework?

Any C++ exception

> Maybe
> just using a BOOST_REQUIRE() statement in the constructor will work?

BOOST_REQUIRE should work just fine. Note that you'll have 1 warning and 1 fatal
failure reported in an output.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at