diff --git a/src/json_reporter.cc b/src/json_reporter.cc index b65a2ca7..985ebb63 100644 --- a/src/json_reporter.cc +++ b/src/json_reporter.cc @@ -287,11 +287,11 @@ void JSONReporter::PrintRunData(Run const& run) { out << indent << FormatKV("real_time", run.real_accumulated_time) << ",\n"; if (run.threads != 1) { - out << indent - << FormatKV( - "per_thread_real_time", - run.real_accumulated_time * static_cast(run.threads)) - << ",\n"; + out << indent + << FormatKV( + "per_thread_real_time", + run.real_accumulated_time * static_cast(run.threads)) + << ",\n"; } out << indent << FormatKV("cpu_time", run.cpu_accumulated_time); } diff --git a/test/output_test_helper.cc b/test/output_test_helper.cc index cc61bb9c..4fcd0d8f 100644 --- a/test/output_test_helper.cc +++ b/test/output_test_helper.cc @@ -108,21 +108,20 @@ void CheckCase(std::stringstream& remaining_output, TestCase const& TC, for (const auto& NC : not_checks) { BM_CHECK(!NC.regex->Match(line)) << "Unexpected match for line \"" << line << "\" for MR_Not regex \"" - << NC.regex_str << "\"" - << "\n actual regex string \"" << TC.substituted_regex << "\"" + << NC.regex_str << "\"" << "\n actual regex string \"" + << TC.substituted_regex << "\"" << "\n started matching near: " << first_line; } if (TC.regex->Match(line)) return; BM_CHECK(TC.match_rule != MR_Next) << "Expected line \"" << line << "\" to match regex \"" << TC.regex_str - << "\"" - << "\n actual regex string \"" << TC.substituted_regex << "\"" - << "\n started matching near: " << first_line; + << "\"" << "\n actual regex string \"" << TC.substituted_regex + << "\"" << "\n started matching near: " << first_line; } BM_CHECK(remaining_output.eof() == false) << "End of output reached before match for regex \"" << TC.regex_str - << "\" was found" - << "\n actual regex string \"" << TC.substituted_regex << "\"" + << "\" was found" << "\n actual regex string \"" + << TC.substituted_regex << "\"" << "\n started matching near: " << first_line; } diff --git a/test/reporter_output_test.cc b/test/reporter_output_test.cc index 63b2d980..00999f73 100644 --- a/test/reporter_output_test.cc +++ b/test/reporter_output_test.cc @@ -10,9 +10,11 @@ // ---------------------- Testing Prologue Output -------------------------- // // ========================================================================= // -ADD_CASES(TC_ConsoleOut, {{"^[-]+$", MR_Next}, - {"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations$", MR_Next}, - {"^[-]+$", MR_Next}}); +ADD_CASES(TC_ConsoleOut, + {{"^[-]+$", MR_Next}, + {"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations$", + MR_Next}, + {"^[-]+$", MR_Next}}); static int AddContextCases() { AddCases(TC_ConsoleErr, { @@ -417,8 +419,9 @@ void BM_Complexity_O1(benchmark::State& state) { BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity(benchmark::o1); SET_SUBSTITUTIONS({{"%bigOStr", "[ ]* %float \\([0-9]+\\)"}, {"%RMS", "[ ]*[0-9]+ %"}}); -ADD_CASES(TC_ConsoleOut, {{"^BM_Complexity_O1_BigO %bigOStr %bigOStr %bigOStr[ ]*$"}, - {"^BM_Complexity_O1_RMS %RMS %RMS %RMS[ ]*$"}}); +ADD_CASES(TC_ConsoleOut, + {{"^BM_Complexity_O1_BigO %bigOStr %bigOStr %bigOStr[ ]*$"}, + {"^BM_Complexity_O1_RMS %RMS %RMS %RMS[ ]*$"}}); // ========================================================================= // // ----------------------- Testing Aggregate Output ------------------------ // @@ -842,20 +845,21 @@ BENCHMARK(BM_UserStats) // check that user-provided stats is calculated, and is after the default-ones // empty string as name is intentional, it would sort before anything else -ADD_CASES(TC_ConsoleOut, {{"^BM_UserStats/iterations:5/repeats:3/manual_time [ " - "]*150 ns [ ]*150 ns [ ]*%time [ ]*5$"}, - {"^BM_UserStats/iterations:5/repeats:3/manual_time [ " - "]*150 ns [ ]*150 ns %time [ ]*5$"}, - {"^BM_UserStats/iterations:5/repeats:3/manual_time [ " - "]*150 ns [ ]*150 ns %time [ ]*5$"}, - {"^BM_UserStats/iterations:5/repeats:3/" - "manual_time_mean [ ]*150 ns [ ]*150 ns %time [ ]*3$"}, - {"^BM_UserStats/iterations:5/repeats:3/" - "manual_time_median [ ]*150 ns [ ]*150 ns %time [ ]*3$"}, - {"^BM_UserStats/iterations:5/repeats:3/" - "manual_time_stddev [ ]*0.000 ns [ ]*0.000 ns %time [ ]*3$"}, - {"^BM_UserStats/iterations:5/repeats:3/manual_time_cv " - "%console_percentage_report[ ]*$"}}); +ADD_CASES(TC_ConsoleOut, + {{"^BM_UserStats/iterations:5/repeats:3/manual_time [ " + "]*150 ns [ ]*150 ns [ ]*%time [ ]*5$"}, + {"^BM_UserStats/iterations:5/repeats:3/manual_time [ " + "]*150 ns [ ]*150 ns %time [ ]*5$"}, + {"^BM_UserStats/iterations:5/repeats:3/manual_time [ " + "]*150 ns [ ]*150 ns %time [ ]*5$"}, + {"^BM_UserStats/iterations:5/repeats:3/" + "manual_time_mean [ ]*150 ns [ ]*150 ns %time [ ]*3$"}, + {"^BM_UserStats/iterations:5/repeats:3/" + "manual_time_median [ ]*150 ns [ ]*150 ns %time [ ]*3$"}, + {"^BM_UserStats/iterations:5/repeats:3/" + "manual_time_stddev [ ]*0.000 ns [ ]*0.000 ns %time [ ]*3$"}, + {"^BM_UserStats/iterations:5/repeats:3/manual_time_cv " + "%console_percentage_report[ ]*$"}}); ADD_CASES( TC_JSONOut, {{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$"},