本文整理汇总了C++中cppunit_ns::TestRunner::result方法的典型用法代码示例。如果您正苦于以下问题:C++ TestRunner::result方法的具体用法?C++ TestRunner::result怎么用?C++ TestRunner::result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cppunit_ns::TestRunner
的用法示例。
在下文中一共展示了TestRunner::result方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: outStream
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;
}