clang-format

This commit is contained in:
Dominic Hamon 2024-08-07 16:47:41 +01:00
parent 3053d1bc83
commit a1c840fd5d
3 changed files with 34 additions and 31 deletions

View File

@ -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<double>(run.threads))
<< ",\n";
out << indent
<< FormatKV(
"per_thread_real_time",
run.real_accumulated_time * static_cast<double>(run.threads))
<< ",\n";
}
out << indent << FormatKV("cpu_time", run.cpu_accumulated_time);
}

View File

@ -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;
}

View File

@ -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\",$"},