| 14 | namespace CppBenchmark { |
| 15 | |
| 16 | void Launcher::Launch(const std::string& pattern) |
| 17 | { |
| 18 | int current = 0; |
| 19 | int total = 0; |
| 20 | std::vector<std::shared_ptr<BenchmarkBase>> benchmarks; |
| 21 | |
| 22 | // Build pending benchmark |
| 23 | for (const auto& builder : _builders) |
| 24 | AddBenchmark(builder()); |
| 25 | |
| 26 | // Filter benchmarks |
| 27 | std::regex matcher(pattern); |
| 28 | for (const auto& benchmark : _benchmarks) |
| 29 | { |
| 30 | // Match benchmark name with the given pattern |
| 31 | if (pattern.empty() || std::regex_match(benchmark->name(), matcher)) |
| 32 | { |
| 33 | total += benchmark->CountLaunches(); |
| 34 | benchmarks.push_back(benchmark); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // Launch filtered benchmarks |
| 39 | for (const auto& benchmark : benchmarks) |
| 40 | benchmark->Launch(current, total, *this); |
| 41 | } |
| 42 | |
| 43 | void Launcher::Report(Reporter& reporter) const |
| 44 | { |
nothing calls this directly
no test coverage detected