mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Update '-list' option (#2457)
'-list' option is used to print all sub-tests. But some test do not support it at all. And all test do not display it the same way, making it quite complicated for external tools to extract them. That CL clean the usage so that tests: - Print the sub-tests list with either '-list' (to prevent breaking legacy usage) or '--list' (to match other options) - Do not print anything else when the option is used
This commit is contained in:
@@ -284,6 +284,11 @@ int main( int argc, const char **argv )
|
||||
|
||||
static int ParseArgs( int argc, const char **argv )
|
||||
{
|
||||
if (gListTests)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
gArgList = (const char **)calloc( argc, sizeof( char*) );
|
||||
|
||||
if( NULL == gArgList )
|
||||
|
||||
@@ -112,6 +112,35 @@ int main(int argc, const char **argv)
|
||||
int error;
|
||||
|
||||
argc = parseCustomParam(argc, argv);
|
||||
if (gListTests)
|
||||
{
|
||||
for (unsigned dst = 0; dst < kTypeCount; dst++)
|
||||
{
|
||||
for (unsigned src = 0; src < kTypeCount; src++)
|
||||
{
|
||||
for (unsigned sat = 0; sat < 2; sat++)
|
||||
{
|
||||
// skip illegal saturated conversions to float type
|
||||
if (gSaturationNames[sat] == std::string("_sat")
|
||||
&& (gTypeNames[dst] == std::string("float")
|
||||
|| gTypeNames[dst] == std::string("half")
|
||||
|| gTypeNames[dst] == std::string("double")))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (unsigned rnd = 0; rnd < kRoundingModeCount; rnd++)
|
||||
{
|
||||
vlog("\t%s\n",
|
||||
(std::string(gTypeNames[dst])
|
||||
+ gSaturationNames[sat] + gRoundingModeNames[rnd]
|
||||
+ "_" + gTypeNames[src])
|
||||
.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (argc == -1)
|
||||
{
|
||||
return 1;
|
||||
|
||||
@@ -83,13 +83,6 @@ int main (int argc, const char **argv )
|
||||
if( (error = ParseArgs( argc, argv )) )
|
||||
goto exit;
|
||||
|
||||
if (gIsEmbedded) {
|
||||
vlog( "\tProfile: Embedded\n" );
|
||||
}else
|
||||
{
|
||||
vlog( "\tProfile: Full\n" );
|
||||
}
|
||||
|
||||
fflush( stdout );
|
||||
error = runTestHarnessWithCheck(
|
||||
argCount, argList, test_registry::getInstance().num_tests(),
|
||||
@@ -114,6 +107,10 @@ exit:
|
||||
|
||||
static int ParseArgs( int argc, const char **argv )
|
||||
{
|
||||
if (gListTests)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int i;
|
||||
argList = (const char **)calloc(argc, sizeof(char *));
|
||||
if( NULL == argList )
|
||||
@@ -217,6 +214,16 @@ static int ParseArgs( int argc, const char **argv )
|
||||
vlog( "*** It gives warm fuzzy feelings and then nevers calls. ***\n\n" );
|
||||
vlog( "*** Wimpy Reduction Factor: %-27u ***\n\n", gWimpyReductionFactor);
|
||||
}
|
||||
|
||||
if (gIsEmbedded)
|
||||
{
|
||||
vlog("\tProfile: Embedded\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
vlog("\tProfile: Full\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -384,21 +384,24 @@ int main(int argc, const char *argv[])
|
||||
error = ParseArgs(argc, argv);
|
||||
if (error) return error;
|
||||
|
||||
// This takes a while, so prevent the machine from going to sleep.
|
||||
PreventSleep();
|
||||
atexit(ResumeSleep);
|
||||
if (!gListTests)
|
||||
{
|
||||
// This takes a while, so prevent the machine from going to sleep.
|
||||
PreventSleep();
|
||||
atexit(ResumeSleep);
|
||||
|
||||
if (gSkipCorrectnessTesting)
|
||||
vlog("*** Skipping correctness testing! ***\n\n");
|
||||
else if (gStopOnError)
|
||||
vlog("Stopping at first error.\n");
|
||||
if (gSkipCorrectnessTesting)
|
||||
vlog("*** Skipping correctness testing! ***\n\n");
|
||||
else if (gStopOnError)
|
||||
vlog("Stopping at first error.\n");
|
||||
|
||||
vlog(" \t ");
|
||||
if (gWimpyMode) vlog(" ");
|
||||
if (!gSkipCorrectnessTesting) vlog("\t max_ulps");
|
||||
vlog(" \t ");
|
||||
if (gWimpyMode) vlog(" ");
|
||||
if (!gSkipCorrectnessTesting) vlog("\t max_ulps");
|
||||
|
||||
vlog("\n-------------------------------------------------------------------"
|
||||
"----------------------------------------\n");
|
||||
vlog("\n---------------------------------------------------------------"
|
||||
"--------------------------------------------\n");
|
||||
}
|
||||
|
||||
gMTdata = MTdataHolder(gRandomSeed);
|
||||
|
||||
@@ -425,6 +428,10 @@ int main(int argc, const char *argv[])
|
||||
|
||||
static int ParseArgs(int argc, const char **argv)
|
||||
{
|
||||
if (gListTests)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
// We only pass test names to runTestHarnessWithCheck, hence global command
|
||||
// line options defined by the harness cannot be used by the user.
|
||||
// To respect the implementation details of runTestHarnessWithCheck,
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
log_info("1st part, non gl-sharing objects...\n");
|
||||
gTestRounding = true;
|
||||
return runTestHarness(argc, argv, test_registry::getInstance().num_tests(),
|
||||
test_registry::getInstance().definitions(), false, 0);
|
||||
|
||||
@@ -1101,20 +1101,19 @@ int main(int argc, const char* argv[])
|
||||
argCount, argList, test_registry::getInstance().num_tests(),
|
||||
test_registry::getInstance().definitions(), true, 0, InitCL);
|
||||
|
||||
if(gQueue)
|
||||
if (gQueue)
|
||||
{
|
||||
int error = clFinish(gQueue);
|
||||
if (error) {
|
||||
if (error)
|
||||
{
|
||||
log_error("clFinish failed: %d\n", error);
|
||||
}
|
||||
if (clReleaseCommandQueue(gQueue) != CL_SUCCESS)
|
||||
log_error("clReleaseCommandQueue\n");
|
||||
}
|
||||
|
||||
if(clReleaseCommandQueue(gQueue)!=CL_SUCCESS)
|
||||
log_error("clReleaseCommandQueue\n");
|
||||
if(clReleaseContext(gContext)!= CL_SUCCESS)
|
||||
if (gContext && clReleaseContext(gContext) != CL_SUCCESS)
|
||||
log_error("clReleaseContext\n");
|
||||
|
||||
|
||||
free(argList);
|
||||
remove(gFileName);
|
||||
return err;
|
||||
|
||||
@@ -630,7 +630,8 @@ int main(int argc, const char* argv[])
|
||||
s_wimpy_mode = true;
|
||||
}
|
||||
|
||||
if (s_wimpy_mode) {
|
||||
if (s_wimpy_mode && !gListTests)
|
||||
{
|
||||
log_info("\n");
|
||||
log_info("*** WARNING: Testing in Wimpy mode! ***\n");
|
||||
log_info("*** Wimpy mode is not sufficient to verify correctness. ***\n");
|
||||
|
||||
@@ -6713,6 +6713,14 @@ cl_device_id get_platform_device (cl_device_type device_type, cl_uint choosen_de
|
||||
return devices[choosen_device_index];
|
||||
}
|
||||
|
||||
static void ListTests()
|
||||
{
|
||||
for (unsigned int i = 0; i < (sizeof(spir_suites) / sizeof(sub_suite)); i++)
|
||||
{
|
||||
log_info("\t%s\n", spir_suites[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Parses the command line parameters and set the
|
||||
@@ -6761,7 +6769,7 @@ static int ParseCommandLine (int argc, const char *argv[],
|
||||
/* Process the command line arguments */
|
||||
|
||||
/* Special case: just list the tests */
|
||||
if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" )))
|
||||
if ((argc > 1) && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
|
||||
{
|
||||
log_info( "Usage: %s [<suite name>] [pid<num>] [id<num>] [<device type>] [w32] [no-unzip]\n", argv[0] );
|
||||
log_info( "\t<suite name>\tOne or more of: (default all)\n");
|
||||
@@ -6771,10 +6779,12 @@ static int ParseCommandLine (int argc, const char *argv[],
|
||||
log_info( "\tw32\t\tIndicates device address bits is 32.\n" );
|
||||
log_info( "\tno-unzip\t\tDo not extract test files from Zip; use existing.\n" );
|
||||
|
||||
for( unsigned int i = 0; i < (sizeof(spir_suites) / sizeof(sub_suite)); i++ )
|
||||
{
|
||||
log_info( "\t\t%s\n", spir_suites[i].name );
|
||||
}
|
||||
ListTests();
|
||||
return 0;
|
||||
}
|
||||
else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-list"))
|
||||
{
|
||||
ListTests();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ int main(int argc, const char *argv[])
|
||||
{
|
||||
gReSeed = 1;
|
||||
bool modifiedSpvBinariesPath = false;
|
||||
bool listTests = false;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
int argsRemoveNum = 0;
|
||||
if (argv[i] == spvBinariesPathArg) {
|
||||
@@ -241,9 +242,12 @@ int main(int argc, const char *argv[])
|
||||
argc -= argsRemoveNum;
|
||||
--i;
|
||||
}
|
||||
listTests |= (argv[i] == std::string("--list")
|
||||
|| argv[i] == std::string("-list"));
|
||||
}
|
||||
if (modifiedSpvBinariesPath == false) {
|
||||
printUsage();
|
||||
if (modifiedSpvBinariesPath == false && !listTests)
|
||||
{
|
||||
printUsage();
|
||||
}
|
||||
|
||||
return runTestHarnessWithCheck(
|
||||
|
||||
Reference in New Issue
Block a user