Boost logo

Boost Users :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2008-07-23 13:23:08


Bruce Trask <bruce.trask <at> mdesystems.com> writes:

>
> Hi,
>
> Does the boost test framework provide facilities out of the box for the
> Abstract Test Pattern?
> http://c2.com/cgi/wiki?AbstractTest

Not sure I follow 100%, but I do not see a need for any direct support per say.
If you are testing some kind of class hierarchy you can do something like:

void test_base_API( Base const& base )
{
  // do tests against Base interface
}

BOOST_AUTO_TEST_CASE( test_concrete_class_1 )
{
    ConcreteClass1 obj(...);

    test_base_API( obj );

    // tests specific to ConcreteTest1
    // ...
}

BOOST_AUTO_TEST_CASE( test_concrete_class_2 )
{
    ConcreteClass2 obj(...);

    test_base_API( obj );

    // tests specific to ConcreteTest2
    // ...
}

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