本文整理汇总了C++中options::which_test方法的典型用法代码示例。如果您正苦于以下问题:C++ options::which_test方法的具体用法?C++ options::which_test怎么用?C++ options::which_test使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类options
的用法示例。
在下文中一共展示了options::which_test方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTests
std::size_t TestFixture::runTests(const options& args)
{
std::string classname(args.which_test());
std::string testname("");
if (classname.find("::") != std::string::npos) {
testname = classname.substr(classname.find("::") + 2);
classname.erase(classname.find("::"));
}
countTests = 0;
errmsg.str("");
const std::list<TestFixture *> &tests = TestRegistry::theInstance().tests();
for (std::list<TestFixture *>::const_iterator it = tests.begin(); it != tests.end(); ++it) {
if (classname.empty() || (*it)->classname == classname) {
(*it)->processOptions(args);
(*it)->run(testname);
}
}
std::cout << "\n\nTesting Complete\nNumber of tests: " << countTests << std::endl;
std::cout << "Number of todos: " << todos_counter;
if (succeeded_todos_counter > 0)
std::cout << " (" << succeeded_todos_counter << " succeeded)";
std::cout << std::endl;
// calling flush here, to do all output before the error messages (in case the output is buffered)
std::cout.flush();
std::cerr << "Tests failed: " << fails_counter << std::endl << std::endl;
std::cerr << errmsg.str();
std::cerr.flush();
return fails_counter;
}