summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-01 21:44:08 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-04 21:45:45 -0500
commit301a9c67aaad103a5fb0cd06d775ded208220f49 (patch)
treee05657855928f9f76f2bc87a1a13904fee6972c5 /src/test
parentcc4c1d22907fe0a69c23edb312fde2e2ac531112 (diff)
test-libudev: disable monitor mode by default and add to automatic tests
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-libudev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c
index 5ac513b013..e28de9b37b 100644
--- a/src/test/test-libudev.c
+++ b/src/test/test-libudev.c
@@ -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;
}