2 * Copyright 2014 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
34 #include <sys/types.h>
36 #include <sys/ioctl.h>
41 #include <linux/limits.h>
43 /* SPECNAMELEN in FreeBSD is defined here: */
44 #include <sys/param.h>
47 #include <sys/mkdev.h>
49 #ifdef MAJOR_IN_SYSMACROS
50 #include <sys/sysmacros.h>
54 #include "xf86drmMode.h"
57 #include "CUnit/Basic.h"
59 #include "amdgpu_test.h"
60 #include "amdgpu_internal.h"
62 /* Test suite names */
63 #define BASIC_TESTS_STR "Basic Tests"
64 #define BO_TESTS_STR "BO Tests"
65 #define CS_TESTS_STR "CS Tests"
66 #define VCE_TESTS_STR "VCE Tests"
67 #define VCN_TESTS_STR "VCN Tests"
68 #define JPEG_TESTS_STR "JPEG Tests"
69 #define UVD_ENC_TESTS_STR "UVD ENC Tests"
70 #define DEADLOCK_TESTS_STR "Deadlock Tests"
71 #define VM_TESTS_STR "VM Tests"
72 #define RAS_TESTS_STR "RAS Tests"
73 #define SYNCOBJ_TIMELINE_TESTS_STR "SYNCOBJ TIMELINE Tests"
74 #define SECURITY_TESTS_STR "Security Tests"
75 #define HOTUNPLUG_TESTS_STR "Hotunplug Tests"
76 #define CP_DMA_TESTS_STR "CP DMA Tests"
79 * Open handles for amdgpu devices
82 int drm_amdgpu[MAX_CARDS_SUPPORTED];
84 /** Open render node to test */
85 int open_render_node = 0; /* By default run most tests on primary node */
87 /** The table of all known test suites to run */
88 static CU_SuiteInfo suites[] = {
90 .pName = BASIC_TESTS_STR,
91 .pInitFunc = suite_basic_tests_init,
92 .pCleanupFunc = suite_basic_tests_clean,
93 .pTests = basic_tests,
96 .pName = BO_TESTS_STR,
97 .pInitFunc = suite_bo_tests_init,
98 .pCleanupFunc = suite_bo_tests_clean,
102 .pName = CS_TESTS_STR,
103 .pInitFunc = suite_cs_tests_init,
104 .pCleanupFunc = suite_cs_tests_clean,
108 .pName = VCE_TESTS_STR,
109 .pInitFunc = suite_vce_tests_init,
110 .pCleanupFunc = suite_vce_tests_clean,
114 .pName = VCN_TESTS_STR,
115 .pInitFunc = suite_vcn_tests_init,
116 .pCleanupFunc = suite_vcn_tests_clean,
120 .pName = JPEG_TESTS_STR,
121 .pInitFunc = suite_jpeg_tests_init,
122 .pCleanupFunc = suite_jpeg_tests_clean,
123 .pTests = jpeg_tests,
126 .pName = UVD_ENC_TESTS_STR,
127 .pInitFunc = suite_uvd_enc_tests_init,
128 .pCleanupFunc = suite_uvd_enc_tests_clean,
129 .pTests = uvd_enc_tests,
132 .pName = DEADLOCK_TESTS_STR,
133 .pInitFunc = suite_deadlock_tests_init,
134 .pCleanupFunc = suite_deadlock_tests_clean,
135 .pTests = deadlock_tests,
138 .pName = VM_TESTS_STR,
139 .pInitFunc = suite_vm_tests_init,
140 .pCleanupFunc = suite_vm_tests_clean,
144 .pName = RAS_TESTS_STR,
145 .pInitFunc = suite_ras_tests_init,
146 .pCleanupFunc = suite_ras_tests_clean,
150 .pName = SYNCOBJ_TIMELINE_TESTS_STR,
151 .pInitFunc = suite_syncobj_timeline_tests_init,
152 .pCleanupFunc = suite_syncobj_timeline_tests_clean,
153 .pTests = syncobj_timeline_tests,
156 .pName = SECURITY_TESTS_STR,
157 .pInitFunc = suite_security_tests_init,
158 .pCleanupFunc = suite_security_tests_clean,
159 .pTests = security_tests,
162 .pName = HOTUNPLUG_TESTS_STR,
163 .pInitFunc = suite_hotunplug_tests_init,
164 .pCleanupFunc = suite_hotunplug_tests_clean,
165 .pTests = hotunplug_tests,
168 .pName = CP_DMA_TESTS_STR,
169 .pInitFunc = suite_cp_dma_tests_init,
170 .pCleanupFunc = suite_cp_dma_tests_clean,
171 .pTests = cp_dma_tests,
177 typedef CU_BOOL (*active__stat_func)(void);
179 typedef struct Suites_Active_Status {
181 active__stat_func pActive;
182 }Suites_Active_Status;
184 static CU_BOOL always_active()
189 static Suites_Active_Status suites_active_stat[] = {
191 .pName = BASIC_TESTS_STR,
192 .pActive = suite_basic_tests_enable,
195 .pName = BO_TESTS_STR,
196 .pActive = always_active,
199 .pName = CS_TESTS_STR,
200 .pActive = suite_cs_tests_enable,
203 .pName = VCE_TESTS_STR,
204 .pActive = suite_vce_tests_enable,
207 .pName = VCN_TESTS_STR,
208 .pActive = suite_vcn_tests_enable,
211 .pName = JPEG_TESTS_STR,
212 .pActive = suite_jpeg_tests_enable,
215 .pName = UVD_ENC_TESTS_STR,
216 .pActive = suite_uvd_enc_tests_enable,
219 .pName = DEADLOCK_TESTS_STR,
220 .pActive = suite_deadlock_tests_enable,
223 .pName = VM_TESTS_STR,
224 .pActive = suite_vm_tests_enable,
227 .pName = RAS_TESTS_STR,
228 .pActive = suite_ras_tests_enable,
231 .pName = SYNCOBJ_TIMELINE_TESTS_STR,
232 .pActive = suite_syncobj_timeline_tests_enable,
235 .pName = SECURITY_TESTS_STR,
236 .pActive = suite_security_tests_enable,
239 .pName = HOTUNPLUG_TESTS_STR,
240 .pActive = suite_hotunplug_tests_enable,
243 .pName = CP_DMA_TESTS_STR,
244 .pActive = suite_cp_dma_tests_enable,
250 * Display information about all suites and their tests
252 * NOTE: Must be run after registry is initialized and suites registered.
254 static void display_test_suites(void)
258 CU_pSuite pSuite = NULL;
259 CU_pTest pTest = NULL;
261 printf("%5s: %2s: %8s: %s\n", "What", "ID", "Status", "Name");
263 for (iSuite = 0; suites[iSuite].pName != NULL; iSuite++) {
265 pSuite = CU_get_suite_by_index((unsigned int) iSuite + 1,
269 fprintf(stderr, "Invalid suite id : %d\n", iSuite + 1);
273 printf("Suite: %2d: %8s: %s\n",
275 pSuite->fActive ? "ENABLED" : "DISABLED",
276 suites[iSuite].pName);
278 if (!pSuite->fActive)
281 for (iTest = 0; suites[iSuite].pTests[iTest].pName != NULL;
283 pTest = CU_get_test_by_index((unsigned int) iTest + 1,
286 fprintf(stderr, "Invalid test id : %d\n", iTest + 1);
289 printf(" Test: %2d: %8s: %s\n",
291 pSuite->fActive && pTest->fActive ? "ENABLED" : "DISABLED",
292 suites[iSuite].pTests[iTest].pName);
297 /** Help string for command line parameters */
298 static const char usage[] =
299 "Usage: %s [-hlpr] [<-s <suite id>> [-t <test id>] [-f]] "
300 "[-b <pci_bus_id> [-d <pci_device_id>]]\n"
302 " l - Display all suites and their tests\n"
303 " r - Run the tests on render node\n"
304 " b - Specify device's PCI bus id to run tests\n"
305 " d - Specify device's PCI device id to run tests (optional)\n"
306 " p - Display information of AMDGPU devices in system\n"
307 " f - Force executing inactive suite or test\n"
308 " h - Display this help\n";
309 /** Specified options strings for getopt */
310 static const char options[] = "hlrps:t:b:d:f";
313 * Return the number of AMD device opened.
315 static int amdgpu_open_devices(int open_render_node)
317 drmDevicePtr devices[MAX_CARDS_SUPPORTED];
323 drmVersionPtr version;
325 for (i = 0; i < MAX_CARDS_SUPPORTED; i++) {
329 drm_count = drmGetDevices2(0, devices, MAX_CARDS_SUPPORTED);
333 "drmGetDevices2() returned an error %d\n",
338 for (i = 0; i < drm_count; i++) {
339 /* If this is not PCI device, skip*/
340 if (devices[i]->bustype != DRM_BUS_PCI)
343 /* If this is not AMD GPU vender ID, skip*/
344 if (devices[i]->deviceinfo.pci->vendor_id != 0x1002)
347 if (open_render_node)
348 drm_node = DRM_NODE_RENDER;
350 drm_node = DRM_NODE_PRIMARY;
353 if (devices[i]->available_nodes & 1 << drm_node)
355 devices[i]->nodes[drm_node],
358 /* This node is not available. */
359 if (fd < 0) continue;
361 version = drmGetVersion(fd);
364 "Warning: Cannot get version for %s."
366 devices[i]->nodes[drm_node],
372 if (strcmp(version->name, "amdgpu")) {
373 /* This is not AMDGPU driver, skip.*/
374 drmFreeVersion(version);
379 drmFreeVersion(version);
381 drm_amdgpu[amd_index] = fd;
385 drmFreeDevices(devices, drm_count);
389 /* Close AMD devices.
391 void amdgpu_close_devices()
394 for (i = 0; i < MAX_CARDS_SUPPORTED; i++)
395 if (drm_amdgpu[i] >=0) {
396 close(drm_amdgpu[i]);
400 /* Print AMD devices information */
401 static void amdgpu_print_devices()
406 /* Open the first AMD device to print driver information. */
407 if (drm_amdgpu[0] >=0) {
408 /* Display AMD driver version information.*/
409 drmVersionPtr retval = drmGetVersion(drm_amdgpu[0]);
411 if (retval == NULL) {
412 perror("Cannot get version for AMDGPU device");
416 printf("Driver name: %s, Date: %s, Description: %s.\n",
417 retval->name, retval->date, retval->desc);
418 drmFreeVersion(retval);
421 /* Display information of AMD devices */
422 printf("Devices:\n");
423 for (i = 0; i < MAX_CARDS_SUPPORTED && drm_amdgpu[i] >=0; i++)
424 if (drmGetDevice2(drm_amdgpu[i],
425 DRM_DEVICE_GET_PCI_REVISION,
427 if (device->bustype == DRM_BUS_PCI) {
429 printf(" domain:%04x",
430 device->businfo.pci->domain);
432 device->businfo.pci->bus);
433 printf(" device:%02x",
434 device->businfo.pci->dev);
435 printf(" function:%01x",
436 device->businfo.pci->func);
437 printf(" vendor_id:%04x",
438 device->deviceinfo.pci->vendor_id);
439 printf(" device_id:%04x",
440 device->deviceinfo.pci->device_id);
441 printf(" subvendor_id:%04x",
442 device->deviceinfo.pci->subvendor_id);
443 printf(" subdevice_id:%04x",
444 device->deviceinfo.pci->subdevice_id);
445 printf(" revision_id:%02x",
446 device->deviceinfo.pci->revision_id);
449 drmFreeDevice(&device);
453 /* Find a match AMD device in PCI bus
454 * Return the index of the device or -1 if not found
456 static int amdgpu_find_device(uint8_t bus, uint16_t dev)
461 for (i = 0; i < MAX_CARDS_SUPPORTED && drm_amdgpu[i] >= 0; i++) {
462 if (drmGetDevice2(drm_amdgpu[i],
463 DRM_DEVICE_GET_PCI_REVISION,
465 if (device->bustype == DRM_BUS_PCI)
466 if ((bus == 0xFF || device->businfo.pci->bus == bus) &&
467 device->deviceinfo.pci->device_id == dev) {
468 drmFreeDevice(&device);
472 drmFreeDevice(&device);
479 static void amdgpu_disable_suites()
481 amdgpu_device_handle device_handle;
482 uint32_t major_version, minor_version, family_id;
483 drmDevicePtr devices[MAX_CARDS_SUPPORTED];
485 int size = sizeof(suites_active_stat) / sizeof(suites_active_stat[0]);
487 if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
488 &minor_version, &device_handle))
491 family_id = device_handle->info.family_id;
493 if (amdgpu_device_deinitialize(device_handle))
496 drm_count = drmGetDevices2(0, devices, MAX_CARDS_SUPPORTED);
498 /* Set active status for suites based on their policies */
499 for (i = 0; i < size; ++i)
500 if (amdgpu_set_suite_active(suites_active_stat[i].pName,
501 suites_active_stat[i].pActive()))
502 fprintf(stderr, "suite deactivation failed - %s\n", CU_get_error_msg());
504 /* Explicitly disable specific tests due to known bugs or preferences */
506 * BUG: Compute ring stalls and never recovers when the address is
507 * written after the command already submitted
509 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
510 "compute ring block test (set amdgpu.lockup_timeout=50)", CU_FALSE))
511 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
513 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
514 "sdma ring block test (set amdgpu.lockup_timeout=50)", CU_FALSE))
515 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
517 /* This test was ran on GFX9 only */
518 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
519 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
520 "gfx ring bad dispatch test (set amdgpu.lockup_timeout=50)", CU_FALSE))
521 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
523 /* This test was ran on GFX9 only */
524 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
525 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
526 "compute ring bad dispatch test (set amdgpu.lockup_timeout=50,50)", CU_FALSE))
527 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
529 /* This test was ran on GFX9 only */
530 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
531 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
532 "gfx ring bad slow dispatch test (set amdgpu.lockup_timeout=50)", CU_FALSE))
533 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
535 /* This test was ran on GFX9 only */
536 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
537 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
538 "compute ring bad slow dispatch test (set amdgpu.lockup_timeout=50,50)", CU_FALSE))
539 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
541 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
542 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
543 "gfx ring bad draw test (set amdgpu.lockup_timeout=50)", CU_FALSE))
544 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
546 /* This test was ran on GFX9 only */
547 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
548 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
549 "gfx ring slow bad draw test (set amdgpu.lockup_timeout=50)", CU_FALSE))
550 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
552 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
553 "sdma ring corrupted header test (set amdgpu.lockup_timeout=50)", CU_FALSE))
554 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
556 if (amdgpu_set_test_active(DEADLOCK_TESTS_STR,
557 "sdma ring slow linear copy test (set amdgpu.lockup_timeout=50)", CU_FALSE))
558 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
560 if (amdgpu_set_test_active(BASIC_TESTS_STR, "bo eviction Test", CU_FALSE))
561 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
563 /* This test was ran on GFX8 and GFX9 only */
564 if (family_id < AMDGPU_FAMILY_VI || family_id > AMDGPU_FAMILY_RV)
565 if (amdgpu_set_test_active(BASIC_TESTS_STR, "Sync dependency Test", CU_FALSE))
566 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
568 /* This test was ran on GFX9 only */
569 if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV) {
570 if (amdgpu_set_test_active(BASIC_TESTS_STR, "Dispatch Test (GFX)", CU_FALSE))
571 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
572 if (amdgpu_set_test_active(BASIC_TESTS_STR, "Dispatch Test (Compute)", CU_FALSE))
573 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
576 /* This test was ran on GFX9 only */
577 if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
578 if (amdgpu_set_test_active(BASIC_TESTS_STR, "Draw Test", CU_FALSE))
579 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
581 /* This test was ran on GFX9 only */
582 //if (family_id < AMDGPU_FAMILY_AI || family_id > AMDGPU_FAMILY_RV)
583 if (amdgpu_set_test_active(BASIC_TESTS_STR, "GPU reset Test", CU_FALSE))
584 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
586 /* You need at least 2 devices for this */
588 if (amdgpu_set_test_active(HOTUNPLUG_TESTS_STR, "Unplug with exported fence", CU_FALSE))
589 fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
592 int test_device_index;
594 int amdgpu_open_device_on_test_index(int render_node)
598 if (amdgpu_open_devices(open_render_node) <= 0) {
599 perror("Cannot open AMDGPU device");
603 if (test_device_index >= 0) {
604 /* Most tests run on device of drm_amdgpu[0].
605 * Swap the chosen device to drm_amdgpu[0].
608 drm_amdgpu[0] = drm_amdgpu[test_device_index];
609 drm_amdgpu[test_device_index] = i;
618 static bool amdgpu_node_is_drm(int maj, int min)
624 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm",
626 return stat(path, &sbuf) == 0;
627 #elif defined(__FreeBSD__)
628 char name[SPECNAMELEN];
630 if (!devname_r(makedev(maj, min), S_IFCHR, name, sizeof(name)))
632 /* Handle drm/ and dri/ as both are present in different FreeBSD version
633 * FreeBSD on amd64/i386/powerpc external kernel modules create node in
634 * in /dev/drm/ and links in /dev/dri while a WIP in kernel driver creates
635 * only device nodes in /dev/dri/ */
636 return (!strncmp(name, "drm/", 4) || !strncmp(name, "dri/", 4));
638 return maj == DRM_MAJOR;
642 char *amdgpu_get_device_from_fd(int fd)
646 char path[PATH_MAX + 1];
647 unsigned int maj, min;
649 if (fstat(fd, &sbuf))
652 maj = major(sbuf.st_rdev);
653 min = minor(sbuf.st_rdev);
655 if (!amdgpu_node_is_drm(maj, min) || !S_ISCHR(sbuf.st_mode))
658 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
665 /* The main() function for setting up and running the tests.
666 * Returns a CUE_SUCCESS on successful running, another
667 * CUnit error code on failure.
669 int main(int argc, char **argv)
671 int c; /* Character received from getopt */
673 int suite_id = -1; /* By default run everything */
674 int test_id = -1; /* By default run all tests in the suite */
675 int pci_bus_id = -1; /* By default PC bus ID is not specified */
676 int pci_device_id = 0; /* By default PC device ID is zero */
677 int display_devices = 0;/* By default not to display devices' info */
678 CU_pSuite pSuite = NULL;
679 CU_pTest pTest = NULL;
680 int display_list = 0;
683 for (i = 0; i < MAX_CARDS_SUPPORTED; i++)
687 /* Parse command line string */
688 opterr = 0; /* Do not print error messages from getopt */
689 while ((c = getopt(argc, argv, options)) != -1) {
695 suite_id = atoi(optarg);
698 test_id = atoi(optarg);
701 pci_bus_id = atoi(optarg);
704 sscanf(optarg, "%x", &pci_device_id);
710 open_render_node = 1;
717 fprintf(stderr, usage, argv[0]);
720 fprintf(stderr, usage, argv[0]);
725 if (amdgpu_open_devices(open_render_node) <= 0) {
726 perror("Cannot open AMDGPU device");
730 if (drm_amdgpu[0] < 0) {
731 perror("Cannot open AMDGPU device");
735 if (display_devices) {
736 amdgpu_print_devices();
737 amdgpu_close_devices();
741 if (pci_bus_id > 0 || pci_device_id) {
742 /* A device was specified to run the test */
743 test_device_index = amdgpu_find_device(pci_bus_id,
746 if (test_device_index >= 0) {
747 /* Most tests run on device of drm_amdgpu[0].
748 * Swap the chosen device to drm_amdgpu[0].
751 drm_amdgpu[0] = drm_amdgpu[test_device_index];
752 drm_amdgpu[test_device_index] = i;
755 "The specified GPU device does not exist.\n");
760 /* Initialize test suites to run */
762 /* initialize the CUnit test registry */
763 if (CUE_SUCCESS != CU_initialize_registry()) {
764 amdgpu_close_devices();
765 return CU_get_error();
768 /* Register suites. */
769 if (CU_register_suites(suites) != CUE_SUCCESS) {
770 fprintf(stderr, "suite registration failed - %s\n",
772 CU_cleanup_registry();
773 amdgpu_close_devices();
777 /* Run tests using the CUnit Basic interface */
778 CU_basic_set_mode(CU_BRM_VERBOSE);
780 /* Disable suites and individual tests based on misc. conditions */
781 amdgpu_disable_suites();
784 display_test_suites();
788 if (suite_id != -1) { /* If user specify particular suite? */
789 pSuite = CU_get_suite_by_index((unsigned int) suite_id,
795 CU_set_suite_active(pSuite, CU_TRUE);
797 if (test_id != -1) { /* If user specify test id */
798 pTest = CU_get_test_by_index(
799 (unsigned int) test_id,
803 CU_set_test_active(pTest, CU_TRUE);
805 CU_basic_run_test(pSuite, pTest);
808 fprintf(stderr, "Invalid test id: %d\n",
810 CU_cleanup_registry();
811 amdgpu_close_devices();
815 CU_basic_run_suite(pSuite);
817 fprintf(stderr, "Invalid suite id : %d\n",
819 CU_cleanup_registry();
820 amdgpu_close_devices();
824 CU_basic_run_tests();
827 CU_cleanup_registry();
828 amdgpu_close_devices();
829 return CU_get_error();