We don't want any of the test devices to match the local machine's DMI
modalias. This was a major drawback in the previous test suite, hacking the
dmi modalias string was nontrivial but a wrong string could cause false
positives or negatives.

The quirks system is internal, so rather than having some fancy API we just
hook it off the environment variable that the test suite always sets. Hacky,
but a lot easier than the other options.

Signed-off-by: Peter Hutterer <[email protected]>
---
 src/quirks.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/quirks.c b/src/quirks.c
index f23ec894..d94da3a7 100644
--- a/src/quirks.c
+++ b/src/quirks.c
@@ -334,6 +334,9 @@ init_dmi(void)
        char *copy = NULL;
        const char *syspath = "/sys/devices/virtual/dmi/id";
 
+       if (getenv("LIBINPUT_RUNNING_TEST_SUITE"))
+               return safe_strdup("dmi:");
+
        udev = udev_new();
        if (!udev)
                return NULL;
-- 
2.14.3

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to