I'd like to choose which test to run using the TextUi::TestRunner class, much like the MFC TestRunner (either command line option or TUI...)... selecting which test to run isn't hard... but I'm having trouble getting CppUnit to run a specific named test.
I tried using the macro CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(), adding the classes to a TestSuite using the TestFactoryRegistry, but the only named test I could run was "All Tests", which is the default. For example (assuming my test class is CTestClass):
using namespace CppUnit;
TestFactoryRegistry ®istry = TestFactoryRegistry.getRegistry();
No matter what I try, runner.run() returns something to the effect that the class cannot be found. The line "runner.run("All Tests") does work.
Does anyone have a code snippet that accomplishes this?
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.