mirror of
https://github.com/monero-project/monero.git
synced 2025-06-02 14:12:33 -04:00
core_tests: add --filter to select which tests to run
This commit is contained in:
parent
eed4dba880
commit
639ca3b1fa
5 changed files with 29 additions and 20 deletions
|
@ -54,25 +54,6 @@
|
|||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TRY_ENTRY();
|
||||
|
@ -97,7 +78,7 @@ int main(int argc, char** argv)
|
|||
if (!r)
|
||||
return 1;
|
||||
|
||||
const std::string filter = glob_to_regex(command_line::get_arg(vm, arg_filter));
|
||||
const std::string filter = tools::glob_to_regex(command_line::get_arg(vm, arg_filter));
|
||||
|
||||
performance_timer timer;
|
||||
timer.start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue