[RFC] Move logic for test registration to the test harness (#2151)

And use in device_timer suite.

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2024-11-26 17:55:09 +00:00
committed by GitHub
parent df5e87bf97
commit 0a1456d8f9
36 changed files with 307 additions and 352 deletions

View File

@@ -23,13 +23,6 @@
#include <unistd.h>
#endif
#include "procs.h"
test_definition test_list[] = {
ADD_TEST( timer_resolution_queries ),
ADD_TEST( device_and_host_timers ),
};
test_status InitCL(cl_device_id device)
{
auto version = get_device_cl_version(device);
@@ -70,11 +63,10 @@ test_status InitCL(cl_device_id device)
return TEST_PASS;
}
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
return runTestHarnessWithCheck( argc, argv, test_num, test_list, false, 0, InitCL );
return runTestHarnessWithCheck(
argc, argv, test_registry::getInstance().num_tests(),
test_registry::getInstance().definitions(), false, 0, InitCL);
}