Re: [Cppunit-devel] Running subset of CPPUnit tests in non-interactive mode
Brought to you by:
blep
|
From: Srivalli A. <sar...@ya...> - 2005-12-23 18:21:23
|
My scenario is slightly different. I have one test-suite and two testcases within that suite. Here is how my class and registration looks like:
class RPTest : public CPPUNIT_NS::TestFixture{
CPPUNIT_TEST_SUITE( RPTest );
CPPUNIT_TEST( testConnection );
CPPUNIT_TEST( testSession );
CPPUNIT_TEST_SUITE_END();
public:
....
};
CPPUNIT_TEST_SUITE_REGISTRATION( RPTest );
I want to print names of testcases within the test suite like
testConnection
testSession
How can I do this?
Anyone tried to run subset of testcases within a test-suite in non-interactive mode? Any suggestions?
Thanks
Srivalli.
Vincent Rivière <vri...@us...> wrote:
> When I try to get name of a testcase it returns only the suite name.
>
> CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
> CPPUNIT_NS::Test *childTest = suite->getChildTestAt( 0 );
> cout << "ChildTestName is: " << childTest->getName() << endl;
>
> CPPUNIT_NS::Test *childTest2 = 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
AssertStringTest
You may have made a mistake somewhere else.
First of all, try this just after calling makeTest():
int count = suite->getChildTestCount();
In my case, I get count == 2.
And you ?
Good luck.
Vincent Rivière.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Cppunit-devel mailing list
Cpp...@li...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel
---------------------------------
Yahoo! for Good - Make a difference this year. |