[Intel-gfx] [PATCH igt] lib/igt_core: fflush stdout after printing subtest results

Paulo Zanoni przanoni at gmail.com
Thu Jun 25 08:52:22 PDT 2015


From: Paulo Zanoni <paulo.r.zanoni at intel.com>

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.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
 lib/igt_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 051bc6a..48a0124 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -829,6 +829,7 @@ 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);
 }
-- 
2.1.4



More information about the Intel-gfx mailing list