Improve exit codes (#32) (#297)

This patch ensures runTestHarness returns either EXIT_FAILURE or
EXIT_SUCCESS to avoid undefined behaviour.
This commit is contained in:
Marco Antognini
2019-05-31 11:43:02 +01:00
committed by Kévin Petit
parent 03813a9674
commit d99f96fe18
4 changed files with 60 additions and 51 deletions

View File

@@ -1,5 +1,5 @@
//
// Copyright (c) 2017 The Khronos Group Inc.
// Copyright (c) 2017-2019 The Khronos Group Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -72,6 +72,8 @@ extern cl_uint gRandomSeed;
// Supply a list of functions to test here. This will allocate a CL device, create a context, all that
// setup work, and then call each function in turn as dictatated by the passed arguments.
// Returns EXIT_SUCCESS iff all tests succeeded or the tests were listed,
// otherwise return EXIT_FAILURE.
extern int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
@@ -79,6 +81,8 @@ extern int runTestHarness( int argc, const char *argv[], int testNum, test_defin
typedef test_status (*DeviceCheckFn)( cl_device_id device );
// Same as runTestHarness, but also supplies a function that checks the created device for required functionality.
// Returns EXIT_SUCCESS iff all tests succeeded or the tests were listed,
// otherwise return EXIT_FAILURE.
extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation,
cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn );