Re: [Cppunit-devel] Running subset of CPPUnit tests in non-interactive mode
Brought to you by:
blep
|
From: <vin...@fr...> - 2005-12-23 10:04:28
|
> When I try to get name of a testcase it returns only the suite name.=20
>=20
> CPPUNIT_NS::Test *suite =3D =
CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
> CPPUNIT_NS::Test *childTest =3D suite->getChildTestAt( 0 );
> cout << "ChildTestName is: " << childTest->getName() << endl;
>=20
> CPPUNIT_NS::Test *childTest2 =3D suite->getChildTestAt( 1 );
> cout << "ChildTestName2 is: " << childTest2->getName() << endl;
Sorry, but for me it works as expected.
I use the lastest CVS version.
I have 2 tests :
class AssertMemoryTest : public CPPUNIT_NS::TestFixture { ... }
CPPUNIT_TEST_SUITE_REGISTRATION(AssertMemoryTest);
class AssertStringTest : public CPPUNIT_NS::TestFixture { ... }
CPPUNIT_TEST_SUITE_REGISTRATION(AssertStringTest);
When I run your code, I get the names of my 2 tests :
AssertMemoryTest=20
AssertStringTest
You may have made a mistake somewhere else.
First of all, try this just after calling makeTest():
int count =3D suite->getChildTestCount();
In my case, I get count =3D=3D 2.
And you ?
Good luck.
Vincent Rivi=E8re.
|