Boost logo

Boost Users :

Subject: Re: [Boost-users] Unit Tests and function calling
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2014-02-02 15:30:55


Charles Yates <charles.yates <at> gmail.com> writes:

>
> Hi,
> Just wanted a second opinion on how best to handle calling functions which
invoke BOOST_REQUIRE and BOOST_CHECK type logic.
>
> For example, if I have a test like:
>
> void stuff( ... )
> {
>     BOOST_REQUIRE( ... );
>     BOOST_CHECK( ... ); 
> }
>
> BOOST_AUTO_TEST( check_stuff )
> {
>     stuff( case1 );
>     stuff( case2 );
>
>     stuff( case3 );
>
> }
>
> in the CLF log case at least, I only see which lines in stuff failed,
> but not which which case.

There is not much you can do in release version of Boost.Test (well you can
add some print statement in staff indicating which case is being tested).

In new Boost.Test there are new tools to help with specifically this
problem: BOOST_TEST_INFO, BOOST_TEST_CONTEXT.

These would provide a context information in case of failures, allowing you
to see where specifically you failed.

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