[PATCH libinput 1/3] tablet: increase the proximity timeout during test runs

Peter Hutterer peter.hutterer at who-t.net
Mon May 28 03:34:08 UTC 2018


This is causing too many false positives and they're not easy to filter out.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c | 9 +++++++--
 test/litest.c      | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index f3895fdd..aa652e9c 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -33,8 +33,9 @@
 #endif
 
 /* The tablet sends events every ~2ms , 50ms should be plenty enough to
-   detect out-of-range */
-#define FORCED_PROXOUT_TIMEOUT ms2us(50)
+   detect out-of-range.
+   This value is higher during test suite runs */
+static int FORCED_PROXOUT_TIMEOUT = 50 * 1000; /* µs */
 
 #define tablet_set_status(tablet_,s_) (tablet_)->status |= (s_)
 #define tablet_unset_status(tablet_,s_) (tablet_)->status &= ~(s_)
@@ -2106,6 +2107,10 @@ evdev_tablet_create(struct evdev_device *device)
 {
 	struct tablet_dispatch *tablet;
 
+	/* Stop false positives caused by the forced proximity code */
+	if (getenv("LIBINPUT_RUNNING_TEST_SUITE"))
+		FORCED_PROXOUT_TIMEOUT = 150 * 1000; /* µs */
+
 	tablet = zalloc(sizeof *tablet);
 
 	if (tablet_init(tablet, device) != 0) {
diff --git a/test/litest.c b/test/litest.c
index fc5dbd18..b72ec444 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -3402,7 +3402,7 @@ litest_timeout_trackpoint(void)
 void
 litest_timeout_tablet_proxout(void)
 {
-	msleep(70);
+	msleep(170);
 }
 
 void
-- 
2.14.3



More information about the wayland-devel mailing list