core_tests: add --filter to select which tests to run

This commit is contained in:
moneromooo-monero 2018-07-06 19:10:39 +01:00
parent eed4dba880
commit 639ca3b1fa
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 29 additions and 20 deletions

View file

@ -919,4 +919,23 @@ std::string get_nix_version_display_string()
return {};
}
}
std::string glob_to_regex(const std::string &val)
{
std::string newval;
bool escape = false;
for (char c: val)
{
if (c == '*')
newval += escape ? "*" : ".*";
else if (c == '?')
newval += escape ? "?" : ".";
else if (c == '\\')
newval += '\\', escape = !escape;
else
newval += c;
}
return newval;
}
}