Get rid of threadTesting.h (#1604)

It only contains a pointer type definition for test functions that
really ought to be provided by testHarness.h.

Signed-off-by: Kévin Petit <kpet@free.fr>

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2023-01-14 15:18:27 +00:00
committed by GitHub
parent 896f43615d
commit 1eeb10296f
17 changed files with 12 additions and 49 deletions

View File

@@ -49,9 +49,11 @@ namespace detail {
struct test_case_registration struct test_case_registration
{ {
test_case_registration(const std::string& name, const basefn ptr) test_case_registration(const std::string& name,
const test_function_pointer ptr)
{ {
::autotest::test_suite::global_test_suite().add(test_definition({ptr, strdup(name.c_str())})); ::autotest::test_suite::global_test_suite().add(
test_definition({ ptr, strdup(name.c_str()) }));
} }
}; };

View File

@@ -34,7 +34,6 @@
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -37,7 +37,6 @@
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -22,7 +22,6 @@
#include <cassert> #include <cassert>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>
#include "threadTesting.h"
#include "errorHelpers.h" #include "errorHelpers.h"
#include "kernelHelpers.h" #include "kernelHelpers.h"
#include "fpcontrol.h" #include "fpcontrol.h"

View File

@@ -16,7 +16,6 @@
#ifndef _testHarness_h #ifndef _testHarness_h
#define _testHarness_h #define _testHarness_h
#include "threadTesting.h"
#include "clImageHelper.h" #include "clImageHelper.h"
#include <string> #include <string>
#include <sstream> #include <sstream>
@@ -67,9 +66,12 @@ Version get_device_cl_version(cl_device_id device);
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
typedef int (*test_function_pointer)(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements);
typedef struct test_definition typedef struct test_definition
{ {
basefn func; test_function_pointer func;
const char *name; const char *name;
Version min_version; Version min_version;
} test_definition; } test_definition;

View File

@@ -1,28 +0,0 @@
//
// Copyright (c) 2017 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.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef _threadTesting_h
#define _threadTesting_h
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/opencl.h>
#endif
typedef int (*basefn)(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements);
#endif // _threadTesting_h

View File

@@ -15,7 +15,6 @@
// //
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
extern int create_program_and_kernel(const char *source, extern int create_program_and_kernel(const char *source,

View File

@@ -15,7 +15,6 @@
// //
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret); extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret);

View File

@@ -34,7 +34,6 @@
#include "harness/imageHelpers.h" #include "harness/imageHelpers.h"
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -38,7 +38,6 @@
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -15,7 +15,6 @@
// //
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/testHarness.h" #include "harness/testHarness.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -32,7 +32,6 @@
#include "harness/imageHelpers.h" #include "harness/imageHelpers.h"
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -15,7 +15,6 @@
// //
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -39,7 +39,7 @@ Agreement as executed between Khronos and the recipient.
class baseTestClass { class baseTestClass {
public: public:
baseTestClass() {} baseTestClass() {}
virtual basefn getFunction() = 0; virtual test_function_pointer getFunction() = 0;
}; };
class spirvTestsRegistry { class spirvTestsRegistry {
@@ -72,11 +72,11 @@ template <typename T> T *createAndRegister(const char *name, Version version)
cl_command_queue queue, int num_elements); \ cl_command_queue queue, int num_elements); \
class test_##name##_class : public baseTestClass { \ class test_##name##_class : public baseTestClass { \
private: \ private: \
basefn fn; \ test_function_pointer fn; \
\ \
public: \ public: \
test_##name##_class(): fn(test_##name) {} \ test_##name##_class(): fn(test_##name) {} \
basefn getFunction() { return fn; } \ test_function_pointer getFunction() { return fn; } \
}; \ }; \
test_##name##_class *var_##name = \ test_##name##_class *var_##name = \
createAndRegister<test_##name##_class>(#name, version); \ createAndRegister<test_##name##_class>(#name, version); \

View File

@@ -20,7 +20,6 @@
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -15,7 +15,6 @@
// //
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"

View File

@@ -15,7 +15,6 @@
// //
#include "harness/errorHelpers.h" #include "harness/errorHelpers.h"
#include "harness/kernelHelpers.h" #include "harness/kernelHelpers.h"
#include "harness/threadTesting.h"
#include "harness/typeWrappers.h" #include "harness/typeWrappers.h"
#include "harness/conversions.h" #include "harness/conversions.h"
#include "harness/mt19937.h" #include "harness/mt19937.h"