当前位置: 首页>>代码示例>>C++>>正文


C++ TestRunner::run方法代码示例

本文整理汇总了C++中TestRunner::run方法的典型用法代码示例。如果您正苦于以下问题:C++ TestRunner::run方法的具体用法?C++ TestRunner::run怎么用?C++ TestRunner::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestRunner的用法示例。


在下文中一共展示了TestRunner::run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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;
}
开发者ID:Karma-Revolutions,项目名称:robot-testing,代码行数:31,代码来源:run.cpp

示例2: main

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;
}
开发者ID:Aspirisha,项目名称:teamcity-cpp,代码行数:31,代码来源:example.cpp

示例3: main

int main (int ac, char **av)
{
    TestRunner runner;
    runner.addTest ("TestDx", TestDx::suite ());
    runner.addTest ("TestDxStateMachine", TestDxStateMachine::suite ());
    return runner.run (ac, av);
}
开发者ID:Abhishekpatil,项目名称:SonATA,代码行数:7,代码来源:testUnitDx.cpp

示例4: main

int main (int ac, char **av)
{
   TestRunner runner;
   runner.addTest("Testlib", Testlib::suite());
   runner.addTest("TestCmdLineParser", TestCmdLineParser::suite());
   return runner.run(ac, av);
}
开发者ID:Abhishekpatil,项目名称:SonATA,代码行数:7,代码来源:testUnit.cpp

示例5: main

int main( int argc, char* argv[] )
{
	TestRunner runner;
	runner.addTest( "CounterTest", tmpCounterTest::suite() );
	runner.addTest( "QuizTest", tmpQuizTest::suite() );
	return runner.run( argc, argv );
}
开发者ID:kaorun55,项目名称:CppUnitxHelper,代码行数:7,代码来源:Tester.cpp

示例6: unitTestAutoMainImpl

	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;
	}
开发者ID:besser82,项目名称:libblocxx-deb,代码行数:27,代码来源:AutoTest.cpp

示例7: create

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 {
开发者ID:BackupTheBerlios,项目名称:dgd-httpd-svn,代码行数:35,代码来源:initd.c

示例8: run

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();
}
开发者ID:joshua-meng,项目名称:Util,代码行数:27,代码来源:unittest_hoster.cpp

示例9: main

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;
}
开发者ID:ZickZakk,项目名称:HTWK_SmartDriving_2016,代码行数:34,代码来源:run_tests.cpp

示例10: main

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);
}
开发者ID:Abhishekpatil,项目名称:SonATA,代码行数:8,代码来源:TestRunnerExample.cpp

示例11: main

int main (int ac, char **av)
{
    TestRunner runner;

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

    return 0;
}
开发者ID:chadaustin,项目名称:isugamedev,代码行数:9,代码来源:TestRunner.cpp

示例12: main

/**
 * 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;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:13,代码来源:unitmain.cpp

示例13: main

int main (int ac, char **av)
{
    TestRunner runner;

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

    return 0;
}
开发者ID:defbobo,项目名称:python-patterns-examples,代码行数:9,代码来源:TestRunner.cpp

示例14: main

int main(int argc, const char* argv[])
{
  TestRunner runner;

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

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

  return !ok;
} // main
开发者ID:QuentinFiard,项目名称:arabica,代码行数:10,代码来源:taggle_test.cpp

示例15: 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;
}
开发者ID:adammartin,项目名称:CplusPlusGameOfLife,代码行数:10,代码来源:GameOfLife.cpp


注:本文中的TestRunner::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。