Boost logo

Boost Users :

Subject: [Boost-users] BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES and BOOST_FAIL
From: Rhys Ulerich (rhys.ulerich_at_[hidden])
Date: 2010-02-18 19:33:49


Is there a way to flag that a Boost.Test auto test case is expected to
utterly fail per BOOST_FAIL? BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES
does not seem to handle this use case correctly.

Running Boost.Test 1.42's example 22 [1] returns EXIT_SUCCESS to the
operating system. When I replace BOOST_CHECK with BOOST_FAIL within
the sample's my_test1 test case the binary returns EXIT_FAILURE to the
OS. I have attached the modified version. I see the same behavior
for BOOST_REQUIRE_MESSAGE(false,...).

The question arises because I'm using BOOST_FAIL within an error
handling callback that I provide to a library. When the library
issues the callback, all hope is lost and I need to unwind the test
case to continue sanely.

Thanks,
Rhys

[1] http://www.boost.org/doc/libs/1_42_0/libs/test/doc/html/utf/user-guide/test-organization/expected-failures.html




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