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


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

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


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

示例1: 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

示例2: 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

示例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 ("ExampleTestCase", ExampleTestCase::suite ());
    runner.addTest ("MulticasterTest", MulticasterTest::suite ());
    runner.addTest ("TestTest", TestTest::suite ());
    return runner.run (ac, av);
}
开发者ID:Abhishekpatil,项目名称:SonATA,代码行数:8,代码来源:TestRunnerExample.cpp

示例5: main

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;
}
开发者ID:YukWu,项目名称:jecl,代码行数:14,代码来源:judo_test.cpp

示例6: 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

示例7: main

int main() {
  TestRunner run;
  run.addTest(EvalNodeTest::isNumberTest, "isNumberTest");
  run.runTests();
  
  return 0;
}
开发者ID:ethanjurman,项目名称:prometheus,代码行数:7,代码来源:EvalNodeTest.cpp

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例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 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
开发者ID:QuentinFiard,项目名称:arabica,代码行数:10,代码来源:filter_test_wide.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[])
{
	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;
}
开发者ID:dziadu,项目名称:FitterFactory,代码行数:52,代码来源:test_runner.cpp


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