1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-29 22:40:33 +08:00

feat: added virtual method to abstract class

This commit is contained in:
varshneydevansh 2023-08-12 08:58:26 +05:30
parent 550ceca687
commit 4132a67034

View File

@ -164,6 +164,17 @@ class TestReporter : public benchmark::BenchmarkReporter {
for (auto rep : reporters_) rep->Finalize();
}
void List(const std::vector<benchmark::internal::BenchmarkInstance>&
benchmarks) override {
// providing summary of bechmarks as of now
int total = benchmarks.size();
int flaggedCount =
std::count_if(benchmarks.begin(), benchmarks.end(),
[](const auto& b) { return b.isFlagSet(); });
std::cout << "Total benchmarks: " << total << ", Flagged: " << flaggedCount
<< std::endl;
}
private:
std::vector<benchmark::BenchmarkReporter*> reporters_;
};