[Boost.Test] Using debuggers
When a debug version of a unit test application using Boost.Test crashes
on Windows, no popup appears that asks for attaching the debugger.
Instead, the process prints a stack dump to standard output and then
exits normally. Attaching the debugger before the process crashes does
not help.
Although this is helpful when running tests automatically with no user
interaction, it makes it very hard to manually debug unit tests that
have crashed.
According to the Boost.Test documentation, it is possible to pass
framework parameters to Boost. In particular, there is a "catch system
errors" parameter, which looks like it should be able to turn off this
behavior (please correct me if I am wrong).
http://www.boost.org/doc/libs/1_35_0/libs/test/doc/components/utf/parameters...
http://www.boost.org/doc/libs/1_35_0/libs/test/doc/components/utf/parameters...
We tried the following (on Windows) and then ran a test case which
caused an access violation:
set BOOST_TEST_CATCH_SYSTEM_ERRORS=no
echo %BOOST_TEST_CATCH_SYSTEM_ERRORS
The process still exited normally after printing a stack dump. We also
tried using a command-line option:
Florian Winter skrev:
When a debug version of a unit test application using Boost.Test crashes on Windows, no popup appears that asks for attaching the debugger. Instead, the process prints a stack dump to standard output and then exits normally. Attaching the debugger before the process crashes does not help.
Is there any way to prevent Boost.Test from catching system errors such as access violations (on Windows) and signals (on Linux and similar platforms) so that conventional debuggers can be used?
Gennadiy, I have had similar problems with Boost.Test. I did manage to use the debugger, when I created the test application directly in visual studio and added the parameters, but I have been unable to get the same behavior when compiling via bjam fro visual slick-edit. IMO, it should be dead-simple to do this. Can we be given a little help? Thanks -Thorsten
Thorsten Ottosen
I have had similar problems with Boost.Test. I did manage to use the debugger, when I created the test application directly in visual studio and added the parameters, but I have been unable to get the same behavior when compiling via bjam fro visual slick-edit.
IMO, it should be dead-simple to do this. Can we be given a little help?
Not really sure. Never had problems like this myself, so I can't reproduce it. You might be able to debug it. Just stop in runtime_config::init and see what value gets assigned to s_catch_sys_errors. Gennadiy
Florian Winter
When a debug version of a unit test application using Boost.Test crashes on Windows, no popup appears that asks for attaching the debugger. Instead, the process prints a stack dump to standard output and then exits normally. Attaching the debugger before the process crashes does not help.
Should work fine. Do you still experience this problem? Moreover later version of UTF should support --auto_start_dbg=yes and will automatically attach debugger once program craches. Gennadiy
participants (3)
-
Florian Winter
-
Gennaidy Rozental
-
Thorsten Ottosen