mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 08:19:02 +00:00
Move printing sub-test information into test harness (#421)
This removes all the duplicated code from each test, and moves it to test harness so that we have single place where this information is printed. Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
committed by
Kévin Petit
parent
19951a2a14
commit
03650057bb
@@ -177,21 +177,7 @@ int main(int argc, const char *argv[])
|
||||
|
||||
int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 );
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
} else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
// Clean up
|
||||
free(argList);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q
|
||||
test_return = test_copy_image_set_3D_2D_array( device, context, queue, &formatList[ i ], false);
|
||||
|
||||
if (test_return) {
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -146,19 +146,6 @@ int main(int argc, const char *argv[])
|
||||
|
||||
int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 );
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
}
|
||||
else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q
|
||||
|
||||
if (test_return)
|
||||
{
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
@@ -250,7 +250,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q
|
||||
test_return = test_fill_image_set_3D( device, context, queue, &formatList[ i ], kInt );
|
||||
|
||||
if (test_return) {
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
@@ -297,7 +297,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q
|
||||
test_return = test_fill_image_set_3D( device, context, queue, &formatList[ i ], kUInt );
|
||||
|
||||
if (test_return) {
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -131,19 +131,6 @@ int main(int argc, const char *argv[])
|
||||
|
||||
int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 );
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
} else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_mem_object_type
|
||||
}
|
||||
|
||||
if (test_return) {
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -138,18 +138,6 @@ int main(int argc, const char *argv[])
|
||||
|
||||
int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 );
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
} else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q
|
||||
}
|
||||
|
||||
if (test_return) {
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -134,20 +134,8 @@ int main(int argc, const char *argv[])
|
||||
|
||||
int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 );
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
} else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
free(argList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void printUsage( const char *execName )
|
||||
|
||||
@@ -181,7 +181,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q
|
||||
}
|
||||
|
||||
if (test_return) {
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_header( &formatList[ i ], true );
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -443,18 +443,6 @@ int main(int argc, const char *argv[])
|
||||
// Restore FP state before leaving
|
||||
RestoreFPState(&oldMode);
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
} else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ int test_read_image_type( cl_device_id device, cl_context context, cl_command_qu
|
||||
}
|
||||
if( retCode != 0 )
|
||||
{
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_read_header( format, imageSampler, true );
|
||||
log_info( "\n" );
|
||||
@@ -296,7 +296,7 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
|
||||
|
||||
if ( ( 0 == is_extension_available( device, "cl_khr_3d_image_writes" )) && (imageType == CL_MEM_OBJECT_IMAGE3D) && (formatTestFn == test_write_image_formats) )
|
||||
{
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "-----------------------------------------------------\n" );
|
||||
log_error( "FAILED: test writing CL_MEM_OBJECT_IMAGE3D images\n" );
|
||||
log_error( "This device does not support the mandated extension cl_khr_3d_image_writes.\n");
|
||||
|
||||
@@ -866,7 +866,7 @@ int test_write_image_formats( cl_device_id device, cl_context context, cl_comman
|
||||
|
||||
if( retCode != 0 )
|
||||
{
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_write_header( &imageFormat, true );
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -178,19 +178,6 @@ int main(int argc, const char *argv[])
|
||||
// Restore FP state before leaving
|
||||
RestoreFPState(&oldMode);
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
|
||||
else
|
||||
log_info("PASSED sub-test.\n");
|
||||
}
|
||||
else if (gTestFailure > 0) {
|
||||
if (gTestCount > 1)
|
||||
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
|
||||
else
|
||||
log_error("FAILED sub-test.\n");
|
||||
}
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ int test_read_image_type( cl_device_id device, cl_context context, cl_command_qu
|
||||
|
||||
if ( ret != 0 )
|
||||
{
|
||||
gTestFailure++;
|
||||
gFailCount++;
|
||||
log_error( "FAILED: " );
|
||||
print_read_header( format, imageSampler, true );
|
||||
log_info( "\n" );
|
||||
|
||||
Reference in New Issue
Block a user