MCPcopy Create free account
hub / github.com/catchorg/Catch2 / parse_log_file_arg

Function parse_log_file_arg

tools/misc/coverage-helper.cpp:58–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58int 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
71std::string catch_path(std::string path) {
72 auto start = path.find("catch");

Callers 1

mainFunction · 0.85

Calls 4

starts_withFunction · 0.85
create_empty_fileFunction · 0.85
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected