|
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