Hi,
How can I generate a text report from all the test cases runned in my MFC application? I'm not sure about how to use the TextOutputter class.
From my application, the only thing I'm doing right now is:
(....) CppUnit::MfcUi::TestRunner runner; runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); runner.run(); (...)
I want to generate a text/xml file with the results right after running all test cases..
How can i do it?
regards
bernardo
here it is.... to generate text file.
std::ofstream ofs; ofs.open(".\\output.txt"); CppUnit::TextOutputter* to = new CppUnit::TextOutputter(&runner.result(), ofs); runner.setOutputter(to);
CppUnit::TestFactoryRegistry& registry=CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest()); bool wasSucessful = runner.run();
Thank Kiran!
Log in to post a comment.
Hi,
How can I generate a text report from all the test cases runned in my MFC application? I'm not sure about how to use the TextOutputter class.
From my application, the only thing I'm doing right now is:
(....)
CppUnit::MfcUi::TestRunner runner;
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
runner.run();
(...)
I want to generate a text/xml file with the results right after running all test cases..
How can i do it?
regards
bernardo
here it is.... to generate text file.
std::ofstream ofs;
ofs.open(".\\output.txt");
CppUnit::TextOutputter* to = new CppUnit::TextOutputter(&runner.result(), ofs);
runner.setOutputter(to);
CppUnit::TestFactoryRegistry& registry=CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest());
bool wasSucessful = runner.run();
Thank Kiran!