Skip to content

Commit 7ea7444

Browse files
committed
Show timing results at the end
Instead of intermixing benchmark results with the suite outputs, keep them all until the end.
1 parent 5e925f4 commit 7ea7444

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

clar.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ clar_report_timings(void)
240240
timing = next;
241241
}
242242

243-
_clar.timings = _clar.last_timing = NULL;
244243
}
245244

246245
static void
@@ -337,11 +336,6 @@ clar_run_suite(const struct clar_suite *suite, const char *filter)
337336
clar_store_timing();
338337
}
339338

340-
if (_clar.report_benchmarks) {
341-
puts("");
342-
clar_report_timings();
343-
}
344-
345339
_clar.active_test = NULL;
346340
CL_TRACE(CL_TRACE__SUITE_END);
347341
}
@@ -410,6 +404,11 @@ clar_parse_args(int argc, char **argv)
410404
}
411405
}
412406

407+
if (_clar.report_benchmarks) {
408+
puts("");
409+
clar_report_timings();
410+
}
411+
413412
if (!found) {
414413
clar_print_onabort("No suite matching '%s' found.\n", argument);
415414
exit(-1);
@@ -476,6 +475,11 @@ clar_test_run()
476475
size_t i;
477476
for (i = 0; i < _clar_suite_count; ++i)
478477
clar_run_suite(&_clar_suites[i], NULL);
478+
479+
if (_clar.report_benchmarks) {
480+
puts("");
481+
clar_report_timings();
482+
}
479483
}
480484

481485
return _clar.total_errors;

0 commit comments

Comments
 (0)