Exemplo n.º 1
0
int main()
{
    TextUi::TestRunner runner;
    runner.addTest(SUITE_CLASS_::suite());
    runner.run();
    cout << "Done!" << endl;
}
Exemplo n.º 2
0
int main(int argc, char** argv) {

	// Create the event manager and test controller
	TestResult controller;

	// Add a listener that colllects test result
	TestResultCollector result;
	controller.addListener(&result);

	// Add a listener that print dots as test run.
	BriefTestProgressListener progress;
	controller.addListener(&progress);

	TextUi::TestRunner runner;
	TestFactoryRegistry &registry = TestFactoryRegistry::getRegistry();
	runner.addTest(registry.makeTest());

	std::cout << std::endl << " === Running Tests " << std::endl;

	runner.run(controller);

	// Print test in a compiler compatible format.
	std::cout << std::endl << " === Test Results" << std::endl;

	CompilerOutputter outputter(&result, stdCOut());
	outputter.write();

	ofstream xmlFile("data/cpptestresults.xml");
	XmlOutputter xmlOut(&result, xmlFile);
	xmlOut.write();



	return result.wasSuccessful() ? 0 : 1;
}
Exemplo n.º 3
0
/**
 * Runs the unit tests in CLI mode printing to the screen.
 * @return success == 0
 */
int runCli()
{
  TextUi::TestRunner runner;
  TestFactoryRegistry &registry = TestFactoryRegistry::getRegistry();
  runner.addTest( registry.makeTest() );
  bool wasSucessful = runner.run( "", false );
  return wasSucessful ? 0 : 1 ;
}
Exemplo n.º 4
0
int main (int argc, char* argv[]) {
    TextUi::TestRunner runner;
    TestFactoryRegistry &registry = TestFactoryRegistry::getRegistry();
    runner.addTest( registry.makeTest() );
    bool failed = runner.run();
    google::protobuf::ShutdownProtobufLibrary();
    return !failed;

}
int main(int argc, char* argv[]) {
  Test *suite = TestFactoryRegistry::getRegistry().makeTest();

  TextUi::TestRunner runner;
  runner.addTest( suite );

  runner.setOutputter( new CompilerOutputter(&runner.result(),cerr));

  bool wasSucessful = runner.run();
  return wasSucessful ? 0 : 1;
}
Exemplo n.º 6
0
int main (int argc, char* argv[]) {
  TextUi::TestRunner runner;
  TestFactoryRegistry& registry = TestFactoryRegistry::getRegistry();

  // run all tests if none specified on command line
  Test* test_to_run = registry.makeTest();
  if (argc>1)
        test_to_run = test_to_run->findTest(argv[1]);

  runner.addTest( test_to_run );
  bool failed = runner.run("", false);
  return !failed;
}
Exemplo n.º 7
0
int main(int argc, char* argv[])
{
    // Get the top level suite from the registry
    Test *suite = TestFactoryRegistry::getRegistry().makeTest();

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

    // Change the default outputter to a compiler error format outputter
    runner.setOutputter( new CompilerOutputter( &runner.result(), cerr ) );
    // Run the tests.
    bool wasSucessful = runner.run();

    // Return error code 1 if the one of test failed.
    return wasSucessful ? 0 : 1;
}
Exemplo n.º 8
0
/**
 * Runs the unit tests, producing the results in a xml file and printing to the screen.
 * @param  outputFile Xml file to place output.
 * @return            0.
 */
int runXml(string outputFile)
{
  TestResult controller;
  TestResultCollector result;
  controller.addListener(&result);

  // BriefTestProgressListener progress;
  // controller.addListener( &progress );

  TextUi::TestRunner runner;
  runner.addTest( TestFactoryRegistry::getRegistry().makeTest() );
  runner.run( controller );

  ofstream xmlFileOut(outputFile.c_str());
  XmlOutputter xmlOut(&result, xmlFileOut);
  xmlOut.write();

  return 0;
}
Exemplo n.º 9
0
int main( int argc, char* argv[] )
{
	try
	{
		//PropertyConfigurator::configure("log4cpp.properties");
		TextUi::TestRunner runner;
		TestFactoryRegistry &registry = TestFactoryRegistry::getRegistry();
		runner.addTest( registry.makeTest() );
		runner.run();
	}
	catch(exception &e )
	{
        cout<<e.what()<<endl;
	}
	catch(...)
	{
		cout<<"unknow exception "<<endl;
	}
    return 0;
}
Exemplo n.º 10
0
int main(int argc, char** argv)
{
	new rl::Logger(
		"./logs/rastullah.log",
		"./logs/ogre.log");
	rl::Logger::getSingleton().setLogDetail(Ogre::LL_LOW); // Tests sollen dokumentieren, nicht die Logs

	TextUi::TestRunner runner;
	TestFactoryRegistry& registry = TestFactoryRegistry::getRegistry();
	runner.addTest(registry.makeTest());
	try
	{
		runner.run();
	}
	catch (rl::Exception& ex)
	{
		std::string message = ex.toString();
		printf("%s", message.c_str());
	}
	return 0;
}
Exemplo n.º 11
0
int main()
{
    TextUi::TestRunner runner;
    runner.addTest( TestFactoryRegistry::getRegistry().makeTest() );
    return runner.run( "", false ) ? 0 : 1;
}