From b7528a95421c25662261a2f22e6c093ae167642d Mon Sep 17 00:00:00 2001 From: Snaipe Date: Thu, 20 Aug 2015 19:56:23 +0200 Subject: [PATCH] Fixed duplicated output when writing in PRE_ALL report hook with a redirected output --- samples/report.out.expected | 1 - src/runner.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/report.out.expected b/samples/report.out.expected index 20217bd..d560277 100644 --- a/samples/report.out.expected +++ b/samples/report.out.expected @@ -1,5 +1,4 @@ criterion_init -criterion_init testing test in category sample Asserts: [1 passed, 1 failed, 2 total] criterion_fini diff --git a/src/runner.c b/src/runner.c index a35a57c..c28da67 100644 --- a/src/runner.c +++ b/src/runner.c @@ -296,6 +296,8 @@ static int criterion_run_all_tests_impl(void) { report(PRE_ALL, set); log(pre_all, set); + fflush(NULL); // flush everything before forking + smart struct criterion_global_stats *stats = stats_init(); map_tests(set, stats, run_test);