]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-libudev: disable monitor mode by default and add to automatic tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 2 Mar 2016 02:44:08 +0000 (21:44 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Mar 2016 02:45:45 +0000 (21:45 -0500)
Makefile.am
src/test/test-libudev.c

index e2d5328c1b1133e568e6649e0ec373ed59fc923e..270f09641b5786298a6fb7b18efdaac16b736526 100644 (file)
@@ -3709,8 +3709,10 @@ endif
 endif
 endif
 
+tests += \
+       test-libudev
+
 manual_tests += \
-       test-libudev \
        test-udev
 
 test_libudev_SOURCES = \
index 5ac513b01319ef7e47584d92c8831a424d345352..e28de9b37b44164a6cd54fdc5bdf2c243d363250 100644 (file)
@@ -350,12 +350,14 @@ static void test_hwdb(struct udev *udev, const char *modalias) {
 
 int main(int argc, char *argv[]) {
         _cleanup_udev_unref_ struct udev *udev = NULL;
+        bool arg_monitor = false;
         static const struct option options[] = {
                 { "syspath",   required_argument, NULL, 'p' },
                 { "subsystem", required_argument, NULL, 's' },
                 { "debug",     no_argument,       NULL, 'd' },
                 { "help",      no_argument,       NULL, 'h' },
                 { "version",   no_argument,       NULL, 'V' },
+                { "monitor",   no_argument,       NULL, 'm' },
                 {}
         };
         const char *syspath = "/devices/virtual/mem/null";
@@ -393,6 +395,10 @@ int main(int argc, char *argv[]) {
                         printf("%s\n", VERSION);
                         return EXIT_SUCCESS;
 
+                case 'm':
+                        arg_monitor = true;
+                        break;
+
                 case '?':
                         return EXIT_FAILURE;
 
@@ -420,7 +426,8 @@ int main(int argc, char *argv[]) {
 
         test_hwdb(udev, "usb:v0D50p0011*");
 
-        test_monitor(udev);
+        if (arg_monitor)
+                test_monitor(udev);
 
         return EXIT_SUCCESS;
 }