Boost logo

Boost Users :

From: John Foster (John.X.Foster_at_[hidden])
Date: 2019-07-12 00:50:38

I am using boost test within a home-grown GUI, and want to access test results (e.g. the failure message and location when a test fails)
The unit_test::test_observer class provides the virtual method:
void assertion_result(boost::unit_test::assertion_result)
However, unit_test::assertion_result is just an enum indicating success or failure. From there, I cannot see how to access further information about the test result.
The framework also provides the class test_tools::assertion_result, which encapsulates an error message, but this only appears to be used for evaluating pre-conditions. (I would have expected this type to be the argument to unit_test::test_observer::assertion_result).
The log output classes appear to provide more information on test results. These are implemented as streams, which makes it non-trivial to extract test result data.
Does anyone know how I can access the information on test results - success/failure, the test code, the location, etc?

John Foster
Associate Director, Quant Analysis
Regulatory Modelling
Credit Risk Analytics and Portfolio
National Australia Bank

Level 15, 500 Bourke St, Melbourne VIC 3000
Tel: +61 (0)3 8641 5228
Email: john.x.foster_at_[hidden]<mailto:John.X.Foster_at_[hidden]>


The information contained in this email communication may be confidential. If you have received this email in error, please notify the sender by return email, delete this email and destroy any copy.

Any advice contained in this email has been prepared without taking into account your objectives, financial situation or needs. Before acting on any advice in this email, National Australia Bank Limited (NAB) recommends that you consider whether it is appropriate for your circumstances. If this email contains reference to any financial products, NAB recommends you consider the Product Disclosure Statement (PDS) or other disclosure document available from NAB, before making any decisions regarding any products.

If this email contains any promotional content that you do not wish to receive, please reply to the original sender and write "Don't email promotional material" in the subject.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at