fprintf(stderr,
" test-binary --output=text --output=xml --file=output.xml\n\n");
fprintf(stderr, "Other parameters:\n");
+ fprintf(stderr, " --test=<test name> Run only one test\n");
fprintf(stderr,
" --regexp='regexp'\t Only selected tests"
" which names match regexp run\n\n");
- fprintf(stderr, " --start=<test id>\tStart from concrete test id");
+ fprintf(stderr, " --start=<test id>\tStart from concrete test id\n");
fprintf(stderr, " --group=<group name>\t Run tests only from one group\n");
fprintf(stderr, " --runignored\t Run also ignored tests\n");
fprintf(stderr, " --list\t Show a list of Test IDs\n");
// Parse each argument
for(std::string &arg : args)
{
+ const std::string test = "--test=";
const std::string regexp = "--regexp=";
const std::string output = "--output=";
const std::string groupId = "--group=";
}
group.second = newList;
}
+ } else if (arg.find(test) == 0) {
+ arg.erase(0, test.length());
+ if (arg.length() == 0) {
+ InvalidArgs();
+ Usage();
+ return -1;
+ }
+
+ if (arg[0] == '\'' && arg[arg.length() - 1] == '\'') {
+ arg.erase(0);
+ arg.erase(arg.length() - 1);
+ }
+
+ if (arg.length() == 0) {
+ InvalidArgs();
+ Usage();
+ return -1;
+ }
+
+ pcrecpp::RE re(arg.c_str());
+ for (auto &group : m_testGroups) {
+ TestCaseList newList;
+ for (auto &tc : group.second)
+ {
+ if (re.FullMatch(tc->GetName())) {
+ newList.push_back(tc);
+ }
+ }
+ group.second = newList;
+ }
} else if(arg.find(onlyFromXML) == 0) {
arg.erase(0, onlyFromXML.length());
if (arg.length() == 0) {