[Beignet] [PATCH] Utests: Don't end an all-tests run when one test fails

Yang, Rong R rong.r.yang at intel.com
Mon Oct 10 13:28:07 UTC 2016


LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Rebecca N. Palmer
> Sent: Saturday, October 8, 2016 21:27
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] Utests: Don't end an all-tests run when one test
> fails
> 
> Signed-off-by: Rebecca N. Palmer <rebecca_palmer at zoho.com>
> ---
>  utests/builtin_global_linear_id.cpp                   | 2 +-
>  utests/builtin_global_size.cpp                        | 2 +-
>  utests/builtin_kernel_block_motion_estimate_intel.cpp | 4 ++--
>  utests/builtin_local_size.cpp                         | 2 +-
>  utests/builtin_num_groups.cpp                         | 2 +-
>  utests/runtime_climage_from_boname.cpp                | 2 +-
>  utests/runtime_flat_address_space.cpp                 | 2 +-
>  7 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/utests/builtin_global_linear_id.cpp
> b/utests/builtin_global_linear_id.cpp
> index 24e1d2e..3e92518 100644
> --- a/utests/builtin_global_linear_id.cpp
> +++ b/utests/builtin_global_linear_id.cpp
> @@ -62,7 +62,7 @@ static void builtin_global_linear_id(void)
>      if (err != CL_SUCCESS)
>      {
>        printf("Error: Failed to execute kernel! %d\n", err);
> -      exit(1);
> +      OCL_ASSERT(0);
>      }
> 
>      clFinish(queue);
> diff --git a/utests/builtin_global_size.cpp b/utests/builtin_global_size.cpp
> index a2ec24a..51ad054 100644
> --- a/utests/builtin_global_size.cpp
> +++ b/utests/builtin_global_size.cpp
> @@ -74,7 +74,7 @@ static void builtin_global_size(void)
>        if (err != CL_SUCCESS)
>        {
>          printf("Error: Failed to write to source array!\n");
> -        exit(1);
> +        OCL_ASSERT(0);
>        }
> 
>        // Run the kernel
> diff --git a/utests/builtin_kernel_block_motion_estimate_intel.cpp
> b/utests/builtin_kernel_block_motion_estimate_intel.cpp
> index 5a48753..15bf761 100644
> --- a/utests/builtin_kernel_block_motion_estimate_intel.cpp
> +++ b/utests/builtin_kernel_block_motion_estimate_intel.cpp
> @@ -41,7 +41,7 @@ void builtin_kernel_block_motion_estimate_intel(void)
>  #endif
>    if(!oclCreateAcceleratorIntel){
>      fprintf(stderr, "Failed to get extension clCreateImageFromLibvaIntel\n");
> -    exit(1);
> +    OCL_ASSERT(0);
>    }
>    cl_accelerator_intel accel = oclCreateAcceleratorIntel(ctx,
> CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,sizeof(cl_motion_est
> imation_desc_intel), &vmedesc, &err);
>    OCL_ASSERT(accel != NULL);
> @@ -123,7 +123,7 @@ void
> builtin_kernel_block_motion_estimate_intel(void)
>  #endif
>    if(!oclReleaseAcceleratorIntel){
>      fprintf(stderr, "Failed to get extension clCreateImageFromLibvaIntel\n");
> -    exit(1);
> +    OCL_ASSERT(0);
>    }
>    oclReleaseAcceleratorIntel(accel);
>    clReleaseProgram(built_in_prog);
> diff --git a/utests/builtin_local_size.cpp b/utests/builtin_local_size.cpp index
> 491175d..a55769b 100644
> --- a/utests/builtin_local_size.cpp
> +++ b/utests/builtin_local_size.cpp
> @@ -59,7 +59,7 @@ static void builtin_local_size(void)
>        if (err != CL_SUCCESS)
>        {
>          printf("Error: Failed to write to source array!\n");
> -        exit(1);
> +        OCL_ASSERT(0);
>        }
> 
>        // Run the kernel
> diff --git a/utests/builtin_num_groups.cpp b/utests/builtin_num_groups.cpp
> index 832766e..764c70b 100644
> --- a/utests/builtin_num_groups.cpp
> +++ b/utests/builtin_num_groups.cpp
> @@ -56,7 +56,7 @@ static void builtin_num_groups(void)
>        if (err != CL_SUCCESS)
>        {
>          printf("Error: Failed to write to source array!\n");
> -        exit(1);
> +        OCL_ASSERT(0);
>        }
> 
>        // Run the kernel
> diff --git a/utests/runtime_climage_from_boname.cpp
> b/utests/runtime_climage_from_boname.cpp
> index 2160886..a228c97 100644
> --- a/utests/runtime_climage_from_boname.cpp
> +++ b/utests/runtime_climage_from_boname.cpp
> @@ -161,7 +161,7 @@ void runtime_climage_from_boname(void)  #endif
>    if(!oclCreateImageFromLibvaIntel){
>      fprintf(stderr, "Failed to get extension clCreateImageFromLibvaIntel\n");
> -    exit(1);
> +    OCL_ASSERT(0);
>    }
>    cl_mem dst = oclCreateImageFromLibvaIntel(ctx, &imageParam, NULL);
> 
> diff --git a/utests/runtime_flat_address_space.cpp
> b/utests/runtime_flat_address_space.cpp
> index cf94cf5..c2d25de 100644
> --- a/utests/runtime_flat_address_space.cpp
> +++ b/utests/runtime_flat_address_space.cpp
> @@ -59,7 +59,7 @@ main(int argc, char *argv[])
>      for (uint32_t i = 0; dst_buffer && i < n; ++i)
>        if (dst_buffer[i] != int(i)) {
>          fprintf(stderr, "run-time flat address space failed\n");
> -        exit(-1);
> +        OCL_ASSERT(0);
>        }
>      clEnqueueUnmapMemObject(queue, dst[j], dst_buffer, 0, NULL, NULL);
>    }
> --
> 2.1.4
> 
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list