我正在添加一些与cppunittest相关的示例代码。其中我想多次或重复执行myTest2 CPPUNIT_TEST。如果有两个或多个类包含一些CPPUNIT_TEST,我想执行一个注册的测试" Ex。 TEST1"多次。怎么做?
class Test1: public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(Test1);
CPPUNIT_TEST(myTest11);
CPPUNIT_TEST(myTest12);
CPPUNIT_TEST_SUITE_END();
public :
void myTest11(void)
{
cout << "%s"<< __func__ << endl;
CPPUNIT_ASSERT(add(10, 5));
}
void myTest12(void)
{
cout << "%s"<< __func__ << endl;
CPPUNIT_ASSERT(sub(10, 5));
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(Test1);