File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -78,18 +78,15 @@ void RunOutputTests(int argc, char* argv[]);
78
78
struct Results;
79
79
typedef std::function< void (Results const &) > ResultsCheckFn;
80
80
81
- // Add a function to check the (CSV) results of a benchmark. These
82
- // functions will be called only after the output was successfully
83
- // checked.
84
- // bm_name_pattern: a name or a regex which will be matched agains
85
- // all the benchmark names. Matching benchmarks
86
- // will be the subject of a call to fn
87
81
size_t AddChecker (const char * bm_name_pattern, ResultsCheckFn fn);
88
82
89
- // Class to hold the (CSV!) results of a benchmark.
83
+ // Class holding the results of a benchmark.
90
84
// It is passed in calls to checker functions.
91
85
struct Results {
92
- std::string name; // the benchmark name
86
+
87
+ // the benchmark name
88
+ std::string name;
89
+ // the benchmark fields
93
90
std::map< std::string, std::string > values;
94
91
95
92
Results (const std::string& n) : name(n) {}
Original file line number Diff line number Diff line change @@ -247,11 +247,11 @@ void ResultsChecker::SetHeader_(const std::string& csv_header) {
247
247
field_names = SplitCsv_ (csv_header);
248
248
}
249
249
250
- // set the values for subscribed benchmarks, and silently ignore all others
250
+ // set the values for a benchmark
251
251
void ResultsChecker::SetValues_ (const std::string& entry_csv_line) {
252
+ if (entry_csv_line.empty ()) return ; // some lines are empty
252
253
CHECK (!field_names.empty ());
253
254
auto vals = SplitCsv_ (entry_csv_line);
254
- if (vals.empty ()) return ;
255
255
CHECK_EQ (vals.size (), field_names.size ());
256
256
results.emplace_back (vals[0 ]); // vals[0] is the benchmark name
257
257
auto &entry = results.back ();
You can’t perform that action at this time.
0 commit comments