Fix parsing of offline compilation options in test_select (#429)

The local parsing of arguments in test_select.c throws away any unknown
arguments.  Pass these to parseCustomParam() before the local argument
parsing, so that the offline compilation options work as expected.

Fixes #327.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
This commit is contained in:
Stuart Brady
2019-08-07 16:23:16 +01:00
committed by Kévin Petit
parent 4cb8fc49f8
commit 67655e6fe5

View File

@@ -58,6 +58,8 @@ static int doTest(cl_command_queue queue, cl_context context,
static void printUsage( void ); static void printUsage( void );
static void TestFinishAtExit(void);
//----------------------------------------- //-----------------------------------------
// Definitions and initializations // Definitions and initializations
//----------------------------------------- //-----------------------------------------
@@ -573,8 +575,17 @@ test_definition test_list[] = {
const int test_num = ARRAY_SIZE( test_list ); const int test_num = ARRAY_SIZE( test_list );
int main(int argc, char* argv[]) int main(int argc, const char* argv[])
{ {
test_start();
atexit(TestFinishAtExit);
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
return EXIT_FAILURE;
}
const char ** argList = (const char **)calloc( argc, sizeof( char*) ); const char ** argList = (const char **)calloc( argc, sizeof( char*) );
if( NULL == argList ) if( NULL == argList )
@@ -653,3 +664,8 @@ static void printUsage( void )
log_info( "\t%s\n", test_list[i].name ); log_info( "\t%s\n", test_list[i].name );
} }
} }
static void TestFinishAtExit(void)
{
test_finish();
}