Boost logo

Boost :

Subject: Re: [boost] [test] BOOST_TEST - universal testing tool
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2012-11-06 09:20:15


2012/11/6 Gennadiy Rozental <rogeeff_at_[hidden]>

> 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.
>

This is nice. How does this work if I spread my suite across multiple
source files? do I need to repeat the decorators in each file?

Regards,
&rzej


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