views:

35

answers:

1

When debugging a C++ Boost.Test application inside VS2010 (VS2008), how to make the debugger stop at Boost.Test assertion failure points?

+1  A: 

I haven't tried this myself, but in theory you'd want to set a breakpoint somewhere in the check_impl function (in the boost_unit_test_library source), probably in the non-PASS cases of its final case statement.

In practice I always just find myself just running the tests again (or the specific problem test, selected with --run_test=...) with a breakpoint on the offending check.

Note that a failing BOOST_REQUIRE results in a throw, so if you enable VS' break-on-C++-exceptions in the debugging options that'll break on those nicely (but not BOOST_CHECKs, which just return and carry on).

timday
Thank you. I also found it useful to follow procedure described in "Microsoft Visual Studio .NET users specific " chapter of the Boost.Test documentation. It permits to set a breakpoint manually at place where a verification is failing.
Serge C