| 56 | } |
| 57 | |
| 58 | int parse_log_file_arg(std::string const& arg) { |
| 59 | assert(starts_with(arg, logfile_prefix) && "Attempting to parse incorrect arg!"); |
| 60 | auto fname = arg.substr(logfile_prefix.size()); |
| 61 | create_empty_file(fname); |
| 62 | std::regex regex("MemoryChecker\\.(\\d+)\\.log", std::regex::icase); |
| 63 | std::smatch match; |
| 64 | if (std::regex_search(fname, match, regex)) { |
| 65 | return std::stoi(match[1]); |
| 66 | } else { |
| 67 | throw std::domain_error("Couldn't find desired expression in string: " + fname); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | std::string catch_path(std::string path) { |
| 72 | auto start = path.find("catch"); |
no test coverage detected