Boost logo

Boost Users :

Subject: [Boost-users] [Test] Making use of boost::exception_diagnostic_information and friends
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2009-08-08 18:53:31


Are there any plans to let the Boost.Test runner make use of the extra
information that the Boost.Exception library is able to 'inject' into
exceptions?

Currently, when an exception is caught by the test runner and it is derived
from std::exception, the report includes the what() string but is not able
to give any infomation about the location the exception was thrown from:
    unknown location(0): fatal error in "cfstr_shellidlist_multiple_items":
    std::runtime_error: All items in a DataObject must have the same parent.

When an exception is thrown using the BOOST_THROW_EXCEPTION() macro, extra
information including the location it was thrown from are added to the
exception:
http://www.boost.org/doc/libs/1_39_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html.
This allows callers to pass an exception to diagnostic_infotmation() and get
a string detailing the exact nature of the exception thrown.

It should be possible to let the test runner extract this information in the
same way that diagnostic_infomation does and use it to improve the test
runner output.

Many thanks.

Alex


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