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:
parent
550ceca687
commit
4132a67034
@ -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_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user