本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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 );
}
示例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;
}
示例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 {
示例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();
}
示例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;
}
示例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);
}
示例11: main
int main (int ac, char **av)
{
TestRunner runner;
runner.addTest ("ExampleTestCase", ExampleTestCase::suite ());
runner.run (ac, av);
return 0;
}
示例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 ®istry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest());
bool wasSucessful = runner.run();
return !wasSucessful;
}
示例13: main
int main (int ac, char **av)
{
TestRunner runner;
runner.addTest ("ProductPersistenceTestCase", ProductPersistenceTestCase::suite ());
runner.run (ac, av);
return 0;
}
示例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
示例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;
}