[igt-dev] [PATCH i-g-t] tests/prime_vgem: Give meaningful messages on SKIP

Ewelina Musial ewelina.musial at intel.com
Thu Dec 12 12:50:35 UTC 2019


On Wed, Dec 11, 2019 at 10:42:43AM +0100, Janusz Krzysztofik wrote:
> Messages displayed on SKIPs introduced by commit 92caadb4e551
> ("tests/prime_vgem: Skip basic-read/write subtests if not supported")
> don't inform clearly enough that those SKIPs are expected behavior.
> Fix it.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
> Cc: Ewelina Musial <ewelina.musial at intel.com>
> ---
>  tests/prime_vgem.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
> index 6595818c..3bdb2300 100644
> --- a/tests/prime_vgem.c
> +++ b/tests/prime_vgem.c
> @@ -46,7 +46,8 @@ static void test_read(int vgem, int i915)
>  	handle = prime_fd_to_handle(i915, dmabuf);
>  	close(dmabuf);
>  
> -	igt_skip_on(__gem_read(i915, handle, 0, &i, sizeof(i)));
> +	igt_skip_on_f(__gem_read(i915, handle, 0, &i, sizeof(i)),
> +		      "PREAD from dma-buf not supported on this hardware\n");
>  
>  	ptr = vgem_mmap(vgem, &scratch, PROT_WRITE);
>  	for (i = 0; i < 1024; i++)
> @@ -83,7 +84,8 @@ static void test_fence_read(int i915, int vgem)
>  	handle = prime_fd_to_handle(i915, dmabuf);
>  	close(dmabuf);
>  
> -	igt_skip_on(__gem_read(i915, handle, 0, &i, sizeof(i)));
> +	igt_skip_on_f(__gem_read(i915, handle, 0, &i, sizeof(i)),
> +		      "PREAD from dma-buf not supported on this hardware\n");
>  
>  	igt_fork(child, 1) {
>  		close(master[0]);
> @@ -195,7 +197,8 @@ static void test_write(int vgem, int i915)
>  	handle = prime_fd_to_handle(i915, dmabuf);
>  	close(dmabuf);
>  
> -	igt_skip_on(__gem_write(i915, handle, 0, &i, sizeof(i)));
> +	igt_skip_on_f(__gem_write(i915, handle, 0, &i, sizeof(i)),
> +		      "PWRITE to dma-buf not supported on this hardware\n");
>  
>  	ptr = vgem_mmap(vgem, &scratch, PROT_READ);
>  	gem_close(vgem, scratch.handle);
> -- 
> 2.21.0
> 

Reviewed-by: Ewelina Musial <ewelina.musial at intel.com>


More information about the igt-dev mailing list