|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-07-21 08:06:07
From: "Gennadiy Rozental" <rogeeff_at_[hidden]>
> Here how one of the MPL tests would look like ( copyright comments
removed):
>
<snip>
> test_suite*
> init_unit_test_suite( int argc, char* argv[] ) {
> test_suite* test = BOOST_TEST_SUITE( "MPL unit test" );
>
> test->add( BOOST_TEST_CASE( &test_advance ), /* 1 - here you could
pun
> expected number of failures */ );
> // BTW I do not see a reason why should we keep one test case per
file,
> since all test cases are named
> // here we could have as much test->add( BOOST_TEST_CASE( &test_??? )
as
> we want
>
> return test;
> }
>
> What do you think?
I think for the case you're testing above, a fully compile-time test is
probably more appropriate.
The problem we were discussing was the testing of the type_traits
replacements. The problem with those is that commonly each trait template
needs 20 or more one-line test cases. It's important to be able to say, on
any given compiler, that you expect a particular subset of these cases to
fail. I don't believe "number of expected failures" is useful at all. One
needs to know which *specific* cases are expected to fail, so that when
changes are made to the library you can tell exactly which failures are
new/old. Having to make a separate function for each test case is too high
a burden on the test writer.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk