コード例 #1
0
ファイル: main.cpp プロジェクト: BackupTheBerlios/xenbee-svn
int
main(int argc, char **argv) {
  CppUnit::TextUi::TestRunner runner;
  CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
  runner.addTest( registry.makeTest() );
  CppUnit::CompilerOutputter *outputter =
    new CppUnit::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
				  );
  return !wasSuccessful;  
}
コード例 #2
0
ファイル: TestMain.cpp プロジェクト: EverydayQA/prima
//CPPUNIT_TEST_SUITE_REGISTRATION(mystringTest);
int main()
{
    CppUnit::Test *test = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    CppUnit::TextTestRunner runner;
    runner.addTest(test);

    //new for formatting
    const std::string format("%p:%l");
    std::ofstream ofile;
    ofile.open("run.log");
    CppUnit::CompilerOutputter* outputter = new
        CppUnit::CompilerOutputter(&runner.result(),ofile);
    outputter->setLocationFormat(format);
    runner.setOutputter(outputter);


    runner.run();
    ofile.close();
    return 0;

}