int main(int argc, char* argv[]) { std::ofstream xmlout("DasherTest.xml"); CPPUNIT_NS::TextTestRunner runner; CPPUNIT_NS::XmlOutputter *outputter = new CPPUNIT_NS::XmlOutputter(&runner.result(), xmlout); runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); runner.run( "", false ); outputter->write(); utils::printMood(runner.result().wasSuccessful()); return runner.result().wasSuccessful() ? 0 : 1; }
int main(int argc, char **argv) { #if ENABLE_LOGGING == 1 mqscommon::LoggingConfigurator::configure(); #endif CPPUNIT_NS::TestResult testresult; CPPUNIT_NS::TestResultCollector collectedresults; testresult.addListener (&collectedresults); #if 0 CPPUNIT_NS::TestRunner runner; CPPUNIT_NS::TestFactoryRegistry ®istry = CPPUNIT_NS::TestFactoryRegistry::getRegistry(); runner.addTest( registry.makeTest() ); runner.run (testresult); std::ofstream outStream("out.xml"); CPPUNIT_NS::XmlOutputter xmloutputter (&collectedresults, outStream); //CPPUNIT_NS::XmlOutputter xmloutputter (&collectedresults, std::cout); xmloutputter.write (); bool wasSuccessful = collectedresults.wasSuccessful () ; #else CPPUNIT_NS::TextUi::TestRunner runner; CPPUNIT_NS::TestFactoryRegistry ®istry = CPPUNIT_NS::TestFactoryRegistry::getRegistry(); runner.addTest( registry.makeTest() ); CPPUNIT_NS::CompilerOutputter *outputter = new CPPUNIT_NS::CompilerOutputter(&runner.result(), std::cout); outputter->setLocationFormat("%p(%l) : "); //outputter->setWrapColumn(19); outputter->setNoWrap(); runner.setOutputter(outputter); bool wasSuccessful = runner.run("", false, // doWait true, // doPrintResult true // doPrintProgress ); #endif return !wasSuccessful; }