dimanche 5 mars 2017

How do I run individual testcases to run to a cppunit runner?

The following piece of code gets all my tests and their testcases and runs them. I am trying to get a few individual testcases and get them alone to run. How do I achieve that?

CPPUNIT_NS::TestFactoryRegistry &reg = CPPUNIT_NS::TestFactoryRegistry::getRegistry("");
CPPUNIT_NS::TextUi::TestRunner runner;   //the runner
runner.addTest(reg.makeTest());
bool wasSucessful = runner.run();

I read that you can iterater through the testcases by getting the list using getTests(), but I was not sure how to do that.

Can someone please help me?

Thanks!

Aucun commentaire:

Enregistrer un commentaire