Re: [PATCH igt] lib/igt_core: fflush stdout after printing subtest results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 25, 2015 at 12:52:22PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxx>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux