本文整理汇总了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 );
}
示例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);
}
示例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 ("ExampleTestCase", ExampleTestCase::suite ());
runner.addTest ("MulticasterTest", MulticasterTest::suite ());
runner.addTest ("TestTest", TestTest::suite ());
return runner.run (ac, av);
}
示例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;
}
示例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;
}
示例7: main
int main() {
TestRunner run;
run.addTest(EvalNodeTest::isNumberTest, "isNumberTest");
run.runTests();
return 0;
}
示例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;
}
示例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;
}
示例10: main
int main (int ac, char **av)
{
TestRunner runner;
runner.addTest ("ExampleTestCase", ExampleTestCase::suite ());
runner.run (ac, av);
return 0;
}
示例11: main
int main (int ac, char **av)
{
TestRunner runner;
runner.addTest ("ProductPersistenceTestCase", ProductPersistenceTestCase::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 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
示例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[])
{
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;
}