void
close_restricted(struct libinput *libinput, int fd);
+bool
+ignore_litest_test_suite_device(struct udev_device *device);
+
void
libinput_seat_init(struct libinput_seat *seat,
struct libinput *libinput,
return libinput->interface->close_restricted(fd, libinput->user_data);
}
+bool
+ignore_litest_test_suite_device(struct udev_device *device)
+{
+ if (!getenv("LIBINPUT_RUNNING_TEST_SUITE") &&
+ udev_device_get_property_value(device, "LIBINPUT_TEST_DEVICE"))
+ return true;
+
+ return false;
+}
+
void
libinput_seat_init(struct libinput_seat *seat,
struct libinput *libinput,
return NULL;
}
+ if (ignore_litest_test_suite_device(udev_device)) {
+ udev_device_unref(udev_device);
+ return NULL;
+ }
+
device = path_create_device(libinput, udev_device, NULL);
udev_device_unref(udev_device);
return device;
if (!streq(device_seat, input->seat_id))
return 0;
+ if (ignore_litest_test_suite_device(udev_device))
+ return 0;
+
devnode = udev_device_get_devnode(udev_device);
/* Search for matching logical seat */
liblitest_la_LIBADD = $(top_builddir)/src/libinput-util.la
liblitest_la_CFLAGS = $(AM_CFLAGS) \
-DLIBINPUT_MODEL_QUIRKS_UDEV_RULES_FILE="\"$(abs_top_builddir)/udev/90-libinput-model-quirks-litest.rules\"" \
- -DLIBINPUT_MODEL_QUIRKS_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\""
+ -DLIBINPUT_MODEL_QUIRKS_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\"" \
+ -DLIBINPUT_TEST_DEVICE_RULES_FILE="\"$(abs_top_srcdir)/udev/80-libinput-test-device.rules\""
if HAVE_LIBUNWIND
liblitest_la_LIBADD += $(LIBUNWIND_LIBS) -ldl
liblitest_la_CFLAGS += $(LIBUNWIND_CFLAGS)
"/91-litest-model-quirks-REMOVEME.rules"
#define UDEV_MODEL_QUIRKS_HWDB_FILE UDEV_HWDB_D \
"/91-litest-model-quirks-REMOVEME.hwdb"
+#define UDEV_TEST_DEVICE_RULE_FILE UDEV_RULES_D \
+ "/91-litest-test-device-REMOVEME.rules"
static int in_debugger = -1;
static int verbose = 0;
litest_copy_file(UDEV_MODEL_QUIRKS_HWDB_FILE,
LIBINPUT_MODEL_QUIRKS_UDEV_HWDB_FILE,
warning);
+ litest_copy_file(UDEV_TEST_DEVICE_RULE_FILE,
+ LIBINPUT_TEST_DEVICE_RULES_FILE,
+ warning);
}
static inline void
{
unlink(UDEV_MODEL_QUIRKS_RULE_FILE);
unlink(UDEV_MODEL_QUIRKS_HWDB_FILE);
+ unlink(UDEV_TEST_DEVICE_RULE_FILE);
}
static void
list_init(&all_tests);
setenv("CK_DEFAULT_TIMEOUT", "10", 0);
+ setenv("LIBINPUT_RUNNING_TEST_SUITE", "1", 1);
mode = litest_parse_argv(argc, argv);
if (mode == LITEST_MODE_ERROR)
libinput-device-group
libinput-model-quirks
-*.rules
+80-libinput-device-groups-litest.rules
+80-libinput-device-groups.rules
+90-libinput-model-quirks-litest.rules
+90-libinput-model-quirks.rules
--- /dev/null
+KERNELS=="*input*", ATTRS{name}=="litest *", ENV{LIBINPUT_TEST_DEVICE}="1"