示例#1
0
int main(int argc, char *argv[]) {

	if(argc < 2) {
        printf("Usage: %s <lua plugin file name>\n", argv[0]);
        printf("for example: %s mytest.lua\n", argv[0]);
		return 0;
	}

    // load the test case plugin
    printf("Loading the plugin... \n");
    LuaPluginLoader loader;
    TestCase* test = loader.open(argv[1]);
    if(test == NULL) {
        printf("%s\n", loader.getLastError().c_str());
        return 0;
	}

    // create a test listener to collect the result
    ConsoleListener listener(false);

    // create a test result and add the listeners
    TestResult result;
    result.addListener(&listener);

    // create a test runner and run the test case
    TestRunner runner;
    runner.addTest(test);
    runner.run(result);

    return 0;
}
示例#2
0
int main(int argc, char **argv) {
    // Create the event manager and test controller
    TestResult controller;
    
    // Add a listener that collects test result
    TestResultCollector result;
    controller.addListener(&result);
    
    // Add the top suite to the test runner
    TestRunner runner;
    runner.addTest(TestFactoryRegistry::getRegistry().makeTest());

    // Listen to progress
    TestListener *listener;
    
    if (jetbrains::teamcity::underTeamcity()) {
        // Add unique flowId parameter if you want to run test processes in parallel
        // See http://confluence.jetbrains.net/display/TCD6/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-MessageFlowId
        listener = new jetbrains::teamcity::TeamcityProgressListener();
    } else {
        listener = new BriefTestProgressListener();
    }
    controller.addListener(listener);

    // Run tests
    runner.run(controller);
    
    delete listener;
    
    return result.wasSuccessful() ? 0 : 1;
}
示例#3
0
int main (int ac, char **av)
{
    TestRunner runner;
    runner.addTest ("TestDx", TestDx::suite ());
    runner.addTest ("TestDxStateMachine", TestDxStateMachine::suite ());
    return runner.run (ac, av);
}
示例#4
0
int main (int ac, char **av)
{
   TestRunner runner;
   runner.addTest("Testlib", Testlib::suite());
   runner.addTest("TestCmdLineParser", TestCmdLineParser::suite());
   return runner.run(ac, av);
}
示例#5
0
int main( int argc, char* argv[] )
{
	TestRunner runner;
	runner.addTest( "CounterTest", tmpCounterTest::suite() );
	runner.addTest( "QuizTest", tmpQuizTest::suite() );
	return runner.run( argc, argv );
}
示例#6
0
	int unitTestAutoMainImpl(int argc, const char** argv)
	{
		TestRunner runner;

		// Pull all the tests out of the global object and shove them in the TestRunner.
		while( haveMoreTests() )
		{
			popTest(runner);
		}

		int failureCount = 0;

		if ( argc < 2 || ( argc == 2 && (::strcmp("all", argv[1]) == 0) ) )
		{
			failureCount = runner.runAll();
		}
		else
		{
			failureCount = runner.run( argv[1] );
		}

		if( failureCount > 0 )
		{
			return 1;
		}
		return 0;
	}
示例#7
0
static void create(varargs int clone)
{
	TestRunner runner;

	COMPILE(HTTP_LOGD);						/* Log daemon */
	COMPILE(DAV_HOME + "initd");			/* Initialize DAV objects */
	COMPILE(HTTP_AUTHENTICATE);				/* Authentication daemon */
	COMPILE(HTTP_AUTHORIZE);				/* Authorization daemon */
#if 0
	COMPILE(HTTP_STATUSD_400_500);			/* Error-page handler */
#endif
	COMPILE(HTTP_SERVER);					/* The web-server */
	COMPILE(HTTP_APP);						/* Web-application container */
	COMPILE(HTTP_MIME);						/* Mime container */
	COMPILE(HTTP_COOKIE);					/* Cookie container */
	COMPILE(HTTP_SESSION);					/* Session container */
	COMPILE(HTTP_USER);						/* http user object */
	COMPILE(HTTP_CONTENT);					/* Content container */
	COMPILE(HTTP_REQUEST);					/* Request object */
	COMPILE(HTTP_RESPONSE);					/* Response object */
	COMPILE(HTTP_URI);						/* URI object */

	/* Run the TestAll test-suite */
	runner = new_object(JORINDE_LUNIT + "data/runner");
	runner->initialize( HTTP_HOME + "tests/TestAll" );
	runner->silent_on_success(TRUE);
	runner->error_on_failure(TRUE);
	runner->run();

	/* Done initializing */
	server = find_object(HTTP_SERVER);		/* ... keep reference to this */
	if(server->is_started()) {
		DGDSYSLOG(server->get_server_string() + " started.\n"); 
		DGDSYSLOG("Log: " + (SERVER_LOG)[1..] + "\n");
	} else {
示例#8
0
bool UnitTestHoster::run()
{
    TestSuite suit;
    
    suit.addTestSuite(TestCaseString("TestCaseString"));
    suit.addTestSuite(TestCaseMemory("TestCaseMemory"));
    suit.addTestSuite(TestCaseTime("TestCaseTime"));
    suit.addTestSuite(TestCaseAny("TestCaseAny"));
    suit.addTestSuite(TestCaseTypeInfo("TestCaseTypeInfo"));
    suit.addTestSuite(TestCaseFile("TestCaseFile"));
    suit.addTestSuite(TestCaseLexicalCast("TestCaseLexicalCast"));
    suit.addTestSuite(TestCaseCsv("TestCaseCsv"));
    suit.addTestSuite(TestCaseCmdLine("TestCaseCmdLine"));
    suit.addTestSuite(TestCaseFactory("TestCaseFactory"));
    suit.addTestSuite(TestCaseRegex("TestCaseRegex"));
    suit.addTestSuite(TestCaseIterator("TestCaseIterator"));
    suit.addTestSuite(TestCaseThread("TestCaseThread"));
    suit.addTestSuite(TestCaseTimer("TestCaseTimer"));
    suit.addTestSuite(TestCaseNet("TestCaseNet"));
    suit.addTestSuite(TestCaseLua("TestCaseLua"));
    suit.addTestSuite(TestCaseJson("TestCaseJson"));
    suit.addTestSuite(TestCaseTrace("TestCaseTrace"));

    TestRunner runner;
    runner.run(suit);
    return runner.isSuccess();
}
int main(int argc, char **argv)
{
    // Create the event manager and test controller
    TestResult controller;

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

    // Add the top suite to the test runner
    TestRunner runner;
    runner.addTest(TestFactoryRegistry::getRegistry().makeTest());

    // Listen to progress
    TestListener *listener;

    if (JetBrains::underTeamcity())
    {
        listener = new JetBrains::TeamcityProgressListener();
    }
    else
    {
        listener = new BriefTestProgressListener();
    }

    controller.addListener(listener);

    // Run test
    runner.run(controller);

    delete listener;

    return result.wasSuccessful() ? 0 : 1;
}
示例#10
0
int main (int ac, char **av)
{
    TestRunner runner;
    runner.addTest ("ExampleTestCase", ExampleTestCase::suite ());
    runner.addTest ("MulticasterTest", MulticasterTest::suite ());
    runner.addTest ("TestTest", TestTest::suite ());
    return runner.run (ac, av);
}
示例#11
0
int main (int ac, char **av)
{
    TestRunner runner;

    runner.addTest ("ExampleTestCase", ExampleTestCase::suite ());
    runner.run (ac, av);

    return 0;
}
示例#12
0
/**
 * include this in your project and it will find all Suite's that have been
 * registered with the CppUnit TextFactoryRegistry and run them
 */
int main( int argc, char* argv[] )
{
    TestRunner runner;
    CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
    runner.addTest(registry.makeTest());
    bool wasSucessful = runner.run();

    return !wasSucessful;
}
int main (int ac, char **av)
{
    TestRunner runner;

    runner.addTest ("ProductPersistenceTestCase", ProductPersistenceTestCase::suite ());
    runner.run (ac, av);

    return 0;
}
示例#14
0
int main(int argc, const char* argv[])
{
  TestRunner runner;

  runner.addTest("TaggleTest", Taggle_test_suite());

  bool ok = runner.run(argc, argv);

  return !ok;
} // main
int main(int argc, char* argv[]) {
	if(argc > 1 && !strcmp(argv[1],"-test")) {
		TestRunner runner;
		return runner.run(argc, argv);
	}
	GameRunner gRunner;
	GameInitializer intializer(gRunner);
	cout << intializer.execute(argc, argv);
	return 0;
}
示例#16
0
int main(int argc, const char* argv[])
{
  TestRunner runner;

  runner.addTest("WhitespaceStripperTest", WhitespaceStripper_test_suite<std::wstring, Arabica::default_string_adaptor<std::wstring> >());

  bool ok = runner.run(argc, argv);

  return !ok;
} // main
示例#17
0
int main (int argc, char* argv[])
{
	std::string testPath = (argc > 1) ? std::string(argv[1]) : "";

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

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

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

	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 );
// 	runner.run(controller);

	try
	{
		std::cout << "Running tests"  /*<<  testPath*/ << endl;;
// 		runner.run( controller, testPath );
		runner.run(controller);

// 		std::cerr << std::endl;

		// Print test in a compiler compatible format.
		CppUnit::CompilerOutputter outputter( &result, std::cerr );
		outputter.write();                      
	}
	catch ( std::invalid_argument &e )  // Test path not resolved
	{
		std::cerr  <<  std::endl  
								<<  "ERROR: "  <<  e.what()
								<< std::endl;
		return 0;
	}

// 	result.runTest();
// 	results.printResults();
// 	runner.prin();

	return result.wasSuccessful() ? 0 : 1;
}
示例#18
0
int main (int argc, char **argv)
{
    TestRunner runner;
    runner.addTest("TestSite", TestSite::suite());
    runner.addTest("TestTuneDxs", TestTuneDxs::suite());
    runner.addTest("TestMisc", TestMisc::suite());
    runner.addTest("TestOffPositions", TestOffPositions::suite());
    runner.addTest("TestRecentRfiMask", TestRecentRfiMask::suite());
    runner.addTest("TestPosition", TestPosition::suite());
    runner.addTest("TestSiteView", TestSiteView::suite());
    runner.addTest("TestTarget", TestTarget::suite());
    return runner.run(argc, argv);
}
示例#19
0
文件: judo_test.cpp 项目: YukWu/jecl
int main(int argc, char** argv)
{
    TestRunner r;

    // Load up all our test suites
    r.addTest("judo", judo::GlobalsTest::getTestSuite());
    r.addTest("judo::CDATA", judo::CDATATest::getTestSuite());
    r.addTest("judo::Element", judo::ElementTest::getTestSuite());
    r.addTest("judo::ElementStream", judo::ElementStreamTest::getTestSuite());

    // Start processing
    r.run(argc, argv);
    return 0;
}
int main (int argc , char** argv)
{
	std::ofstream xml("./cppUnit_output.xml",ios::app);
	
	CppUnit::TestResult controller;
	CppUnit::TestResultCollector result;
	controller.addListener( &result );
	
	TestRunner runner;
	runner.addTest(Manipulation_test::suite());
	runner.run(controller);
	
	CppUnit::XmlOutputter outputter( &result, xml );
	CppUnit::TextOutputter outputter2( &result, std::cerr );
	outputter.write();
	outputter2.write();
	
	return result.wasSuccessful() ? 0 : 1 ;
}
示例#21
0
    virtual void run() {
        TestResultCollector collector;

        // create a test result and add the listeners
        TestResult result;
        result.addListener(&collector);

        // create a test runner
        TestRunner runner;
        MyTest test1;
        MyTest2 test2;
        runner.addTest(&test1);
        runner.addTest(&test2);
        runner.run(result);

        //RTF_TEST_REPORT(Asserter::format("count: %d", collector.failedCount()));
        RTF_TEST_CHECK(collector.testCount() == 2, "Checking tests count");
        RTF_TEST_CHECK(collector.passedCount() == 1, "Checking passed count");
        RTF_TEST_CHECK(collector.failedCount() == 1, "Checking failed count");
    }
示例#22
0
/*
 * Run the test suite, return 0 on success, 1 on error.
 */
int main(void) {


	TestResult controller;

	TestResultCollector result;
	controller.addListener(&result);

	BriefTestProgressListener progress;
	controller.addListener(&progress);

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

	CompilerOutputter outputter(&result, std::cerr);
	outputter.write();

	return result.wasSuccessful() ? 0 : 1;
}
示例#23
0
bool XPath_test_suite(int argc, const char** argv)
{
  TestRunner runner;

  runner.addTest("ValueTest", ValueTest_suite<string_type, string_adaptor>());
  runner.addTest("ArithmeticTest", ArithmeticTest_suite<string_type, string_adaptor>());
  runner.addTest("RelationalTest", RelationalTest_suite<string_type, string_adaptor>());
  runner.addTest("LogicalTest", LogicalTest_suite<string_type, string_adaptor>());
  runner.addTest("AxisEnumeratorTest", AxisEnumeratorTest_suite<string_type, string_adaptor>());
  runner.addTest("NodeTestTest", NodeTestTest_suite<string_type, string_adaptor>());
  runner.addTest("StepTest", StepTest_suite<string_type, string_adaptor>());
  runner.addTest("ParseTest", ParseTest_suite<string_type, string_adaptor>());
  runner.addTest("ExecuteTest", ExecuteTest_suite<string_type, string_adaptor>());
  runner.addTest("ExpressionTest", ExpressionTest_suite<string_type, string_adaptor>());
  runner.addTest("MatchTest", MatchTest_suite<string_type, string_adaptor>());
  runner.addTest("AttributeValueTest", AttributeValueTest_suite<string_type, string_adaptor>());
  runner.addTest("TextNodeTest", TextNodeTest_suite<string_type, string_adaptor>());

  return runner.run(argc, argv);
} // XPath_test_suite
示例#24
0
/*! Runs the named test case.
 *
 * \param testName Name of the test case to run. If an empty is given, then
 *                 all added tests are run. The name can be the name of any
 *                 test in the hierarchy.
 * \param doWait if \c true then the user must press the RETURN key 
 *               before the run() method exit.
 * \param doPrintResult if \c true (default) then the test result are printed
 *                      on the standard output.
 * \param doPrintProgress if \c true (default) then TextTestProgressListener is
 *                        used to show the progress.
 * \return \c true is the test was successful, \c false if the test
 *         failed or was not found.
 */
bool
TextTestRunner::run( std::string testName,
                       bool doWait,
                       bool doPrintResult,
                       bool doPrintProgress )
{
  TextTestProgressListener progress;
  if ( doPrintProgress )
    m_eventManager->addListener( &progress );

  TestRunner *pThis = this;
  pThis->run( *m_eventManager, testName );

  if ( doPrintProgress )
    m_eventManager->removeListener( &progress );

  printResult( doPrintResult );
  wait( doWait );

  return m_result->wasSuccessful();
}
示例#25
0
int main(int argc, char** argv)
{
	TestResult testresult;
	TestResultCollector collectedresults;
    BriefTestProgressListener progress;

    testresult.addListener(&collectedresults);
    testresult.addListener(&progress);

    TestRunner testrunner;
    testrunner.addTest (TestFactoryRegistry::getRegistry().makeTest());
    testrunner.run(testresult);

    CompilerOutputter compileroutputter(&collectedresults, std::cerr);
    compileroutputter.write();

	// Output XML for Jenkins CPPunit plugin
	/*ofstream xmlFileOut("cppTestBasicMathResults.xml");
	XmlOutputter xmlOut(&collectedresults, xmlFileOut);
	xmlOut.write();*/

    return collectedresults.wasSuccessful() ? 0 : 1;
}
示例#26
0
int main(int argc, char **argv) {
    TestResult controller;
    TestResultCollector result;
    controller.addListener(&result);

    BriefTestProgressListener progress;
    controller.addListener(&progress);

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

    // compiler output
    CompilerOutputter coutputter(&result, stdCOut());
    coutputter.write();

    // output test result for jenkins 
    std::ofstream ofs("test_result.xml");
    CPPUNIT_NS::XmlOutputter outputter(&result, ofs,"UTF-8");
    outputter.write();

    return result.wasSuccessful() ? 0 : 1;
}
示例#27
0
int main (int ac, char **av)
{
    TestRunner runner;
    runner.addTest ("TestSseInterfaceLib", TestSseInterfaceLib::suite ());
    return runner.run (ac, av);
}
示例#28
0
int main(int argc, char **argv)
{
   TestRunner runner;
   runner.addTest("TestAngle", TestAngle::suite());
   return runner.run(argc, argv);
}
示例#29
0
int main (int argc, char **argv)
{
    TestRunner runner;
    runner.addTest ("ConditionTest ", ConditionTest::suite ());
    return runner.run (argc, argv);
}