diff mbox

[i-g-t,1/4] tests/kms_flip: only print the activity indicator if output is a terminal

Message ID 1412004498-8449-1-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood Sept. 29, 2014, 3:28 p.m. UTC
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 tests/kms_flip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Daniel Vetter Sept. 29, 2014, 4:39 p.m. UTC | #1
On Mon, Sep 29, 2014 at 04:28:15PM +0100, Thomas Wood wrote:
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
> ---
>  tests/kms_flip.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> index 3d3aa9b..8551f64 100644
> --- a/tests/kms_flip.c
> +++ b/tests/kms_flip.c
> @@ -885,7 +885,10 @@ static unsigned int run_test_step(struct test_output *o)
>  		join_vblank_wait_thread();
>  	}
>  
> -	igt_info("."); fflush(stdout);
> +	if (isatty(STDOUT_FILENO)) {
> +		igt_info(".");
> +		fflush(stdout);
> +	}

Hm, igt_interactive_info() to wrap this?
-Daniel

>  
>  	if (do_flip && (o->flags & TEST_HANG)) {
>  		hang = hang_gpu(drm_fd);
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 3d3aa9b..8551f64 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -885,7 +885,10 @@  static unsigned int run_test_step(struct test_output *o)
 		join_vblank_wait_thread();
 	}
 
-	igt_info("."); fflush(stdout);
+	if (isatty(STDOUT_FILENO)) {
+		igt_info(".");
+		fflush(stdout);
+	}
 
 	if (do_flip && (o->flags & TEST_HANG)) {
 		hang = hang_gpu(drm_fd);