From 639ca3b1fa9c153a99f1d4e9bb488bd02d282e46 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 6 Jul 2018 19:10:39 +0100 Subject: core_tests: add --filter to select which tests to run --- src/common/util.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/common/util.cpp') diff --git a/src/common/util.cpp b/src/common/util.cpp index 7d9d7b408..f644c573c 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -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; + } } -- cgit v1.2.3