I have a boost test case that does some checks using BOOST_CHECK*
, so failures don't immediately stop the test. But at some point, I'd like to stop if any test failures have occurred so far, because the rest of the test is pointless to run if the sanity checks have failed? For example:
BOOST_AUTO_TEST_CASE(test_something) {
Foo foo;
BOOST_CHECK(foo.is_initialized());
BOOST_CHECK(foo.is_ready());
BOOST_CHECK(foo.is_connected());
// ...
// I want something like this:
BOOST_REQUIRE_CHECKS_HAVE_PASSED();
foo.do_something();
BOOST_CHECK(foo.is_successful());
}
The state of the current test can be checked as follows: