Skip to content

Commit

Permalink
Show timing results at the end
Browse files Browse the repository at this point in the history
Instead of intermixing benchmark results with the suite outputs, keep
them all until the end.
  • Loading branch information
carlosmn committed Dec 22, 2015
1 parent 5e925f4 commit 7ea7444
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions clar.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ clar_report_timings(void)
timing = next;
}

_clar.timings = _clar.last_timing = NULL;
}

static void
Expand Down Expand Up @@ -337,11 +336,6 @@ clar_run_suite(const struct clar_suite *suite, const char *filter)
clar_store_timing();
}

if (_clar.report_benchmarks) {
puts("");
clar_report_timings();
}

_clar.active_test = NULL;
CL_TRACE(CL_TRACE__SUITE_END);
}
Expand Down Expand Up @@ -410,6 +404,11 @@ clar_parse_args(int argc, char **argv)
}
}

if (_clar.report_benchmarks) {
puts("");
clar_report_timings();
}

if (!found) {
clar_print_onabort("No suite matching '%s' found.\n", argument);
exit(-1);
Expand Down Expand Up @@ -476,6 +475,11 @@ clar_test_run()
size_t i;
for (i = 0; i < _clar_suite_count; ++i)
clar_run_suite(&_clar_suites[i], NULL);

if (_clar.report_benchmarks) {
puts("");
clar_report_timings();
}
}

return _clar.total_errors;
Expand Down

0 comments on commit 7ea7444

Please sign in to comment.