Boost test support for "Abstract Test Pattern"
Hi, Does the boost test framework provide facilities out of the box for the Abstract Test Pattern? http://c2.com/cgi/wiki?AbstractTest Thanks in advance. Regards, Bruce
AMDG Bruce Trask wrote:
Does the boost test framework provide facilities out of the box for the Abstract Test Pattern? http://c2.com/cgi/wiki?AbstractTest
BOOST_AUTO_TEST_CASE_TEMPLATE is similar. In Christ, Steven Watanabe
Steven Watanabe wrote:
AMDG
Bruce Trask wrote:
Does the boost test framework provide facilities out of the box for the Abstract Test Pattern? http://c2.com/cgi/wiki?AbstractTest
BOOST_AUTO_TEST_CASE_TEMPLATE is similar.
Indeed. That works great. Hadn't considered that. Almost too simple. Thanks Steve. Regards, Bruce
In Christ, Steven Watanabe
Bruce Trask
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
participants (3)
-
Bruce Trask
-
Gennadiy Rozental
-
Steven Watanabe