[PATCH libdrm] tests: skip drmdevice test if the machine doesn't have any drm device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Error message was invalid too, negative values aren't the number of
devices, they're errno error codes.

Signed-off-by: Eric Engestrom <eric.engestrom@xxxxxxxxx>
---
This fixes the Gitlab CI; goes from:
https://gitlab.freedesktop.org/mesa/drm/-/jobs/42061
to:
https://gitlab.freedesktop.org/eric/libdrm/-/jobs/42099
---
 tests/drmdevice.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/drmdevice.c b/tests/drmdevice.c
index cdf6e8deaf121899bcbc..f1c1cd3a0338d912f60c 100644
--- a/tests/drmdevice.c
+++ b/tests/drmdevice.c
@@ -115,8 +115,9 @@ main(void)
     max_devices = drmGetDevices2(0, NULL, 0);
 
     if (max_devices <= 0) {
-        printf("drmGetDevices2() has returned %d\n", max_devices);
-        return -1;
+        printf("drmGetDevices2() has not found any devices (errno=%d)\n",
+               -max_devices);
+        return 77;
     }
     printf("--- Devices reported %d ---\n", max_devices);
 
-- 
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux