[Exceptional C++ Style] Item 12: Exception Safety: Is it Wort hit?
James Dennett
jdennett at acm.org
Fri Dec 3 11:07:29 EST 2004
On Friday, December 3, 2004, at 01:31 AM, Ric Parkin wrote:
>
>
> From: "Paul Grenyer" <paul at paulgrenyer.co.uk>
>> This is a matter of opinion. I personally like to clean up properly,
>> even
>> when an application has failed. Kevlin and I had a disagreement a few
>> weeks
>> back (on accu-general I think??) about whether failed unit tests
>> should
>> clear up properly. I think they should...
>
> That reminds me of a really tricky problem with unit testing under
> C++....
>
> ...crashes.
>
> How do people's test harness cope with the code you're testing having
> a bug that provokes an access violation/core dump?
>
I think the way is obvious, no?
> I think boost.test does something rather clever too - runs the test
> under a seperate thread (process?) so if that test
> crashes/deadlocks/goes into an infinite loop then it can kill it and
> carry on.
>
That's normal; have a monitor process which reports if the process
excecuting the test dies.
And make sure the monitor is as near as possible to bug-free (i.e.,
keep it simple, stupid).
-- James
More information about the Effective-cpp
mailing list