MCPcopy Create free account
hub / github.com/chronoxor/CppBenchmark / Launch

Method Launch

source/benchmark/launcher.cpp:16–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace CppBenchmark {
15
16void 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
43void Launcher::Report(Reporter& reporter) const
44{

Callers

nothing calls this directly

Calls 1

CountLaunchesMethod · 0.45

Tested by

no test coverage detected