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

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 25 12:55:09 PDT 2015


On Thu, Jun 25, 2015 at 12:52:22PM -0300, Paulo Zanoni wrote:
> 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);

If you add a blank line here,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list