aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Harvey <danielharvey458@gmail.com>2019-03-17 14:38:51 +0100
committerRoman Lebedev <lebedev.ri@gmail.com>2019-03-17 16:38:51 +0300
commitf6e96861a373c90ea0c727177fc68d2984e048bb (patch)
treeac097ace0dd1c609daef7e2fe2a00adcb7023775 /include
parentdf7c7ee1d37dda0fb597586b4624515166a778d0 (diff)
downloadgoogle-benchmark-f6e96861a373c90ea0c727177fc68d2984e048bb.tar.gz
BENCHMARK_CAPTURE() and Complexity() - naming problem (#761)
Created BenchmarkName class which holds the full benchmark name and allows specifying and retrieving different components of the name (e.g. ARGS, THREADS etc.) Fixes #730.
Diffstat (limited to 'include')
-rw-r--r--include/benchmark/benchmark.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h
index e4f3921..2954ff4 100644
--- a/include/benchmark/benchmark.h
+++ b/include/benchmark/benchmark.h
@@ -1302,6 +1302,23 @@ struct SystemInfo {
BENCHMARK_DISALLOW_COPY_AND_ASSIGN(SystemInfo);
};
+// BenchmarkName contains the components of the Benchmark's name
+// which allows individual fields to be modified or cleared before
+// building the final name using 'str()'.
+struct BenchmarkName {
+ std::string function_name;
+ std::string args;
+ std::string min_time;
+ std::string iterations;
+ std::string repetitions;
+ std::string time_type;
+ std::string threads;
+
+ // Return the full name of the benchmark with each non-empty
+ // field separated by a '/'
+ std::string str() const;
+};
+
// Interface for custom benchmark result printers.
// By default, benchmark reports are printed to stdout. However an application
// can control the destination of the reports by calling
@@ -1340,7 +1357,7 @@ class BenchmarkReporter {
max_bytes_used(0) {}
std::string benchmark_name() const;
- std::string run_name;
+ BenchmarkName run_name;
RunType run_type; // is this a measurement, or an aggregate?
std::string aggregate_name;
std::string report_label; // Empty if not set by benchmark.