mirror of
https://github.com/google/benchmark.git
synced 2025-04-29 22:40:33 +08:00
feat: improvement with display_reporter, FormatKV
This commit is contained in:
parent
fa29daba02
commit
139e29c609
@ -591,13 +591,7 @@ size_t RunSpecifiedBenchmarks(BenchmarkReporter* display_reporter,
|
||||
}
|
||||
|
||||
if (FLAGS_benchmark_list_tests) {
|
||||
if (FLAGS_benchmark_format == "json") {
|
||||
JSONReporter json_reporter;
|
||||
json_reporter.List(benchmarks);
|
||||
} else {
|
||||
benchmark::ConsoleReporter console_reporter;
|
||||
console_reporter.List(benchmarks);
|
||||
}
|
||||
display_reporter->List(benchmarks);
|
||||
} else {
|
||||
internal::RunBenchmarks(benchmarks, display_reporter, file_reporter);
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ void JSONReporter::List(
|
||||
Out << "[";
|
||||
for (size_t i = 0; i < benchmarks.size(); ++i) {
|
||||
const auto& benchmark = benchmarks[i];
|
||||
Out << "{ \"name\": \"" << benchmark.name().str() << "\" }";
|
||||
Out << "{" << FormatKV("name", benchmark.name().str()) << "}";
|
||||
if (i != benchmarks.size() - 1) {
|
||||
Out << ", ";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user