Boost logo

Boost Users :

Subject: Re: [Boost-users] Aborting on Boost.Test check failure
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-03-05 15:21:04


On Mon, 5 Mar 2012, Ovanes Markarian wrote:

>
>
> On Mon, Mar 5, 2012 at 5:22 PM, Jeremiah Willcock <jewillco_at_[hidden]> wrote:
> On Mon, 5 Mar 2012, Gennadiy Rozental wrote:
>
> Jeremiah Willcock <jewillco <at> osl.iu.edu> writes:
>
>
> Is there a way to force an abort() or some other kind of
> debugger-catchable event when a Boost.Test test case (such as a
> BOOST_CHECK) fails?  Is there a function I can set a breakpoint on?  I do
> not see anything like that in the documentation.  I am running on Linux
> with gdb.
>
>
>
> You can switch to BOOST_REQUIRE and catch throw.
>
>
> Does that mean needing to change all of the tests to use that?  Also, what about doing that in a program that throws (and catches) other exceptions not related to
> test failures?
>
>
> Is using of GDB catchpoints an option for you (http://www.delorie.com/gnu/docs/gdb/gdb_31.html)? Or would you like to automate it somehow? Boost Test offers to start a
> debugger when an exception is raised, I never tried it out, but seems to be an interesting runtime-option
> (auto_start_dbg): http://www.boost.org/doc/libs/1_46_1/libs/test/doc/html/utf/user-guide/runtime-config/reference.html. Is it going to work with gdb as well?

Yes, as long as there are directions for what to do. The auto_start_dbg
option didn't seem to work; it appears that option will only catch system
errors, not test failures (at least from what I read in the
documentation).

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net