c++ - how to catch exception in cppunit -
we use cppunit test our test framework
the tests organized in test fixtures (inherited cppunit_ns::testfixture)
there new requirement - flush out application buffer @ end of test if has failed.
i can in overloaded teardown() function in test fixture. how know if test has failed.
the result of test checked using cppunit_assert.
there around 12 test fixtures each fixture having around 10 tests. how achieve minimal code change?
i think depends bit on how call tests first idea use testlistener , react testlistener::addfailure call.
note teardown can in theory throw exception (possibly through cppunit_assert) call testlistener::addfailure.
if not work obvious ugly solution set flag @ end of each test method signals test finished , call code when flag not set.
Comments
Post a Comment