Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] reporting tests with warnings
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2011-11-15 21:13:32


Olaf Meeuwissen <olaf.meeuwissen <at> avasys.jp> writes:

> So what I want to do is report the number of tests that passed all of
> their BOOST_REQUIRE_* and BOOST_CHECK_* assertions, but failed one or
> more BOOST_WARN_* assertions.
>
> So anyone have any suggestions?

There is no "legal" way to get what you want in Boost.Test now. I suggest you
file a ticket and I'll consider it for next release.

Meanwhile, the only component which gets any information about warnings is unit
test log. You can "hack" around a bit to get the desired behavior by
implementing custom unit_test_log_formatter.

log_entry_start method receives log_entry_type, which will be equal to
BOOST_UTL_ET_WARNING in case of warning. You can trap this event (don't forget
to forward to the regular formatter after that)

Using framework::current_test_case you can implement your own registry for the
warnings information. Combine it with regular Boost.Test output and you'll get
what you looking for.

HTH,

Gennadiy


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