test: if we don't have a uinput device node, skip the test suite
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 1 Nov 2017 04:19:21 +0000 (14:19 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 1 Nov 2017 04:23:21 +0000 (14:23 +1000)
When running ninja dist in a container, we cannot create devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/litest.c

index 637452445b40b879d510def9abd3bf22b5a750b9..021e19f191d3a9193464c22eb50117d85ccdfaff 100644 (file)
@@ -3583,6 +3583,13 @@ main(int argc, char **argv)
                return 77;
        }
 
+       if (access("/dev/uinput", F_OK) == -1 &&
+           access("/dev/input/uinput", F_OK) == -1) {
+               fprintf(stderr,
+                       "uinput device is missing, skipping tests.\n");
+               return 77;
+       }
+
        litest_init_test_devices();
 
        list_init(&all_tests);