Boost logo

Boost :

Subject: Re: [boost] [test] BOOST_TEST - universal testing tool
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2012-11-06 08:42:18


Andrzej Krzemienski <akrzemi1 <at> gmail.com> writes:
> From the perspective of my usage, I guess it could be set per suite, if
> this is possible. Per-test would require too much repetition, unless I
> could define it in my fixture and have the test framework somehow read it
> from the fixture.

What about interface like this:

BOOST_TEST_DECORATORS(
+ decorator::tolerance(1e-6)
)
BOOST_AUTO_TEST_CASE( foo )
{
    BOOST_TEST( foo == 1.5 );
}

BOOST_TEST_DECORATORS(
+ decorator::percent_tolerance(1e-5)
)
BOOST_AUTO_TEST_SUITE(s1)

BOOST_AUTO_TEST_CASE( foo )
{
    BOOST_TEST( foo == 1.5 );
}

BOOST_AUTO_TEST_SUITE_END

Similar functionality can be implemented using fixture decorator, which already
exists.

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk