
Rhys Ulerich wrote:
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.
Hmm. Strange. I thought I've replied to this post. The answer is no. You can only "expect" non-fatal errors
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.
There is no reason to use fatal error here. Since you can register any callback you want the easiest solution is to bind result_status variable to the callback and set it to false if processing failed. Once outside of the library call if can check the flag value and continue or not depending on it's value. You can also "expect" that this value is false, but the further testing is still aborted. Gennadiy