Fix test skip handling while test initialization - device_timer (#667)

This commit is contained in:
Grzegorz Wawiorko
2020-03-10 19:25:49 +01:00
committed by GitHub
parent 4b281af946
commit 51cd792e9e
3 changed files with 23 additions and 5 deletions

View File

@@ -67,6 +67,21 @@ int runTestHarness( int argc, const char *argv[], int testNum, test_definition t
( imageSupportRequired ) ? verifyImageSupport : NULL );
}
int skip_init_info(int count) {
log_info("Test skipped while initialization\n");
log_info("SKIPPED %d of %d tests.\n", count, count);
return EXIT_SUCCESS;
}
int fail_init_info(int count) {
log_info("Test failed while initialization\n");
log_info("FAILED %d of %d tests.\n", count, count);
return EXIT_FAILURE;
}
void version_expected_info(const char * test_name, const char * expected_version, const char * device_version) {
log_info("%s skipped (requires at least version %s, but the device reports version %s)\n",
test_name, expected_version, device_version);
}
int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
int forceNoContextCreation, cl_command_queue_properties queueProps,
DeviceCheckFn deviceCheckFn )
@@ -447,9 +462,9 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
case TEST_PASS:
break;
case TEST_FAIL:
return EXIT_FAILURE;
return fail_init_info(testNum);
case TEST_SKIP:
return EXIT_SUCCESS;
return skip_init_info(testNum);
}
}
@@ -689,8 +704,7 @@ test_status callSingleTestFunction( test_definition test, cl_device_id deviceToU
const Version device_version = get_device_cl_version(deviceToUse);
if (test.min_version > device_version)
{
log_info("%s skipped (requires at least version %s, but the device reports version %s)\n",
test.name, test.min_version.to_string().c_str(), device_version.to_string().c_str());
version_expected_info(test.name, test.min_version.to_string().c_str(), device_version.to_string().c_str());
return TEST_SKIP;
}
@@ -936,3 +950,4 @@ void PrintArch( void )
}
#endif
}

View File

@@ -129,6 +129,7 @@ extern cl_device_type GetDeviceType( cl_device_id );
extern cl_device_id GetOpposingDevice( cl_device_id device );
Version get_device_cl_version(cl_device_id device);
void version_expected_info(const char * test_name, const char * expected_version, const char * device_version);
extern int gFlushDenormsToZero; // This is set to 1 if the device does not support denorms (CL_FP_DENORM)