[Please do not mail me a copy of your followup]
boost@lists.boost.org spake the secret code
I work on a team that uses compiles with exception support disabled. (That... is not my decision, and no value judgments on that, please. :-))
I'd kind of like to use the unit test library.
Is it possible to compile your tests with exceptions enabled and simply link against your code that isn't using exceptions? Remember, you're not shipping your unit tests, so whatever has caused you to decide against exceptions for production code could be relaxed for your unit tests.
However, at a surface level it has lots of uses of raw try/catch/throw instead of BOOST_TRY/BOOST_CATCH/BOOST_THROW.
If you do things like BOOST_REQUIRE_EQUAL and the assertion fails, it does indeed use an exception to terminate the execution of the test case. Exceptions are pretty much the only mechanism you're going to find that supports this. If you do BOOST_CHECK, then it simply records the failure of the test case and continues executing. However, I find that REQUIRE is the behavior that I want all the time -- if I've identified a failed assertion, I don't see the point of continuing to execute the test, particularly when it may just crash the whole executable if I continue executing it.
How hopeless is using the library with BOOST_NO_EXCEPTIONS?
Modifying the library not to use exceptions would be a significant
amount of work, I think. There are other unit test frameworks that
provide much less and don't use exceptions.
You might also take a look at