diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-25 14:12:56 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-26 17:35:39 -0300 |
commit | 6cc553adf298e6244fbdb5fe03841c00ddda29ad (patch) | |
tree | 1ddffcb0a230ada7e8248c4ba50fad45c86c5207 /lib/igt_core.c | |
parent | f78574101ffc3388ba7a948a6f5310358cdeaab2 (diff) |
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>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 051bc6a4..735b56db 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -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); } |