From d5c705a53967b75a7211b3914a64838aac655c3f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 28 May 2018 10:38:12 +1000 Subject: [PATCH] tablet: increase the proximity timeout during test runs This is causing too many false positives and they're not easy to filter out. Signed-off-by: Peter Hutterer --- 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