lib/igt_core: fflush stdout after printing subtest results

I often run "sudo ./test 2>&1 | tee output.txt", and when we're
succeeding - never printing to stderr - the output gets buffered and
is never flushed (because it doesn't point to a terminal), so I never
know which test is running. With this fflush, I'm able to know when
each test finishes.

v2: Add blank line too (Chris)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
Paulo Zanoni 2015-06-25 14:12:56 -03:00
parent f78574101f
commit 6cc553adf2

View File

@ -829,6 +829,8 @@ static void exit_subtest(const char *result)
elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9;
printf("Subtest %s: %s (%.3fs)\n", in_subtest, result, elapsed);
fflush(stdout);
in_subtest = NULL;
siglongjmp(igt_subtest_jmpbuf, 1);
}