test
test copied to clipboard
Provide an option to disable exception catching
Some times it's useful to just let unexpected exceptions do their work in tests. Especially when debugging. For example, gtest provides the option --gtest_catch_exceptions=0 or the environment variable GTEST_CATCH_EXCEPTIONS, where the test framework doesn't catch any exceptions if any of these options is set to 0.
Granted, catching unexpected exceptions by default is helpful because otherwise the tests will abort. But then during debugging (at the dev's will, for example, using a command line argument like the one above), it's much easier to catch unintended bug by just letting the tests/program fire and abort the program. A debugger will immediately show the correct stack trace and the source of the problem.
I think adding such a command line argument (and maybe also environment variable) is very useful and saves lots of time when debugging.
Isn't the command line argument --catch_system_errors doing this already? Or maybe it is still catching things?
Well, given that the default value of --catch_system_errors is no, then it's obviously not working.
The documentation seems to be wrong ! I can see the following code
#ifdef BOOST_TEST_DEFAULTS_TO_CORE_DUMP
false,
#else
true,
#endif
which seems to be doing the exact opposite of the documentation.
Would it be possible for you to explicitly indicate --catch-system-error=no and let me know if this works for you?
I'm sorry, but I'm in a very bad health condition that I'm almost incapacitated I can't do anything right now. If someone else can do this, that'd be great.
I am sorry to hear that, take care and get well soon
I can confirm the framework does not catch system exceptions with --catch_system_errors=no.
I also believe the documentation and implementation have the values swapped.
Locally we have #defined BOOST_TEST_DEFAULTS_TO_CORE_DUMP to get the expected default.