コード例 #1
0
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;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: 17605699101/oolua
int main(int argc, char** argv)
{
	(void)argc;
	(void)argv;

#	ifdef USING_XML_OUTPUT
		CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
		CPPUNIT_NS::TextTestRunner runner;
		std::ofstream stream("tests.xml");
		CPPUNIT_NS::XmlOutputter* xml = new CPPUNIT_NS::XmlOutputter(&runner.result(),stream);
		xml->setStyleSheet("report.xsl");
		runner.setOutputter(xml);
		runner.addTest( suite );
		//return runner.run() ? 0 : 1;
		bool result = runner.run();
		//as they may fail lets not brake a build yet just report the error
		//return 0;
		return !result;
#	else
		CppUnit::TextUi::TestRunner runner;
		CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
		runner.addTest( registry.makeTest() );
		runner.run( "", false );
		//as they may fail lets not brake a build yet just report the error
		//return 0;
		return !runner.run( "", false );
#	endif


}
コード例 #3
0
ファイル: main.cpp プロジェクト: ehelms/sunray
int main ( int argc, char *argv[] )
{
	CPPUNIT_NS::TextTestRunner runner;
	CPPUNIT_NS::CompilerOutputter outputter(&runner.result(), std::cerr);
	runner.setOutputter(&outputter);
	runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
	runner.run("", true);

	return 0;
}
コード例 #4
0
ファイル: Main.cpp プロジェクト: deeice/bunjalloo
int main(int argc, char* argv[])
{
  // Get the top level suite from the registry
  CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();

  // Adds the test to the list of test to run
  CPPUNIT_NS::TextTestRunner runner;
  runner.addTest( suite );

  // Change the default outputter to a compiler error format outputter
  runner.setOutputter( new CPPUNIT_NS::CompilerOutputter( &runner.result(), std::cout  ) );
  // Run the test.
  bool wasSucessful = runner.run();

  // Return error code 1 if the one of test failed.
  return wasSucessful ? 0 : 1;
}