Commit graph

1460 commits

Author SHA1 Message Date
Peter Hutterer
114021a6c1 test: add dwt modifier/fkey test cases
dwt shouldn't trigger on those keys

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-04 12:57:02 +10:00
Peter Hutterer
00ceff3245 test: just use litest_add_device if we don't have overrides
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 14:24:04 +10:00
Peter Hutterer
6cde53fc1d test: if we're in a debugger, use single-fork mode only
Don't fork by default if we're in gdb.

Note that is_debugger_attached() is now inside #ifndef LITEST_NO_MAIN, gdb for
the litest selftest will now require a manual CK_FORK=no.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:03 +10:00
Peter Hutterer
681f967c8f test: if a filter is specified, don't parallelize jobs by default
Likely testing a specific set of tests, possibly in gdb. So don't parallelize.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:03 +10:00
Peter Hutterer
13a88a762c test: split the tap tests into more tap groups
We're grouping by test suites, so split up the suites a bit further. The tap
tests all have timeouts and thus take forever, splitting them across multiple
forks means we can finish the test suite quicker.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:03 +10:00
Peter Hutterer
152fe5fc5f test: remove NOTPARALLEL
We only have a single test runner now, so no need to restrict it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:02 +10:00
Peter Hutterer
eb8e1d4a13 test: add a make-like job control to run tests in parallel
Add a make-like -j/--jobs option to split the number of parallel test
processes. Defaults to 8 if not specified, future patches will default this to
1 for special cases where filters are specified or gdb is detected.

Each subprocess overwrites argv[0] to be easier identifiable in the ps
output when we're trying to figure out which tests are still running.

A -j1 is equivalent to the previous functionality, i.e. we don't fork.

One quirk needed for check: any test case not part of a test runner will not
be freed and thus triggers valgrind. We do test filtering by splitting
up the tests across multiple forks (i.e. each process has several tests that
are in the list but not added to the runner). Thus we need to mark those we
expect check to free as used.
Then on cleanup we traverse the test list, add all the unused one to a
test runner and free that test runner (without actually running it). This
cleans up both the filtered tests in each subprocess and the whole test list
in the parent process which doesn't run a test itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:26:58 +10:00
Peter Hutterer
1d5c1fedb4 test: drop the sysname comparison in the device add/remove test
Running tests in parallel virtually guarantees a different device is added in
between. What we're testing here is that the device comes back and the
original ref doesn't send events, so a false test failure would still indicate
a bug anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
68841bfd52 Revert "test: create a lock file to avoid parallel udev reloads during device add"
Not needed anymore, we only have one process creating the udev rules.

This reverts commit 030ec053fb.
2016-08-02 10:19:38 +10:00
Peter Hutterer
51fb42cb60 test: restore the hwdb/udev rules on SIGINT
We can't call system() in the signal handler but we are allowed to fork. Do
that, update the hwdb and immediately exit the child again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
f9f4bb0266 test: make sure we remove all udev rules when we SIGINT the test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
a7f04c9a84 test: only init the device rules once
The udev hwdb takes about 200ms and we still trigger it on each device. The
udev rules don't actually change after compiling, so simply create them
once and remove them after the test run.

For multiple test binaries this needed to be synchronized (which is hard),
hence the previous merge into a single binary for all tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
35b28b1af3 test: merge all tests into a single binary
Call it a libinput-test-suite-runner, in subsequent patches we'll handle doing
parallel tests ourselves instead of relying on automake features.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
bc76bd6f77 test: store created udev rules in a list for easier deletion
Easier to clean up than knowing all the destination paths we'll install.
Only affects global udev rules so far.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 14:49:45 +10:00
Peter Hutterer
c4a21a4e9e test: make the valgrind test an actual dependency of the test run
With parallel builds the valgrind test run would run at the same time as the
normal run, the test suite isn't designed for that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 14:49:45 +10:00
Peter Hutterer
5c03500d8e test: make the interfaces static
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 12:23:08 +10:00
Peter Hutterer
f787e8699c test: namespace the bitfield helper tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 12:23:05 +10:00
Peter Hutterer
889c27f0b2 test: fix prefix for the gestures time test
No real effect, just for consistency.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 12:23:01 +10:00
Peter Hutterer
3758f3cdef test: make one ALPS and the Synaptics i2c test devices Dell touchpads
The i2c one came from an Dell XPS13. The ALPS one I can't remember but highly
likely they were on Dells and if not, nothing really changes here anyway
because it's not a clickpad and right now only clickpads have dell-specific
behaviour.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-18 11:15:00 +10:00
Peter Hutterer
8e7f99c27a touchpad: don't init a horizontal scroll area on touchpads <50mm high
We simply don't have enough space on those touchpads to have an area carved
out for horizontal scrolling. Given that horizontal scrolling is rarely needed
anyway users of these touchpads will just have to cling to scroll bars or use
two-finger scrolling.

Exception are small clickpads because they already have an area blocked off
for software buttons and those small clickpads generally come from a time when
clickfinger wasn't much of a thing yet.

https://bugs.freedesktop.org/show_bug.cgi?id=96910

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-15 10:47:29 +10:00
Peter Hutterer
ef3c7437ef test: split edge scroll tests into one for vert, one for horiz
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-15 09:18:44 +10:00
Peter Hutterer
e06701201f test: add a Cintiq 13 HDT test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-12 15:14:30 +10:00
Peter Hutterer
3c113111fa Remove LIBINPUT_EVENT_TABLET_PAD_MODE event
Unimplemented and it wasn't supposed to be in the series.

https://lists.freedesktop.org/archives/wayland-devel/2016-June/029376.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-07-11 11:00:51 +10:00
Peter Hutterer
6a3f1e9e10 test: write the valgrind test results to a different output file
Otherwise we overwriting the output from the normal test run.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-06 08:30:58 +10:00
Peter Hutterer
601cdeeb95 test: up the timeout to 30s
10s is not enough when running the test suite in parallel as any test may have
to wait longer than that to get access to the udev lock. Especially for
tests with multiple timeouts it was too easy to trigger timeouts.

Up the timeout to 30s, this seems reliable enough now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-07-05 11:28:43 +10:00
Peter Hutterer
030ec053fb test: create a lock file to avoid parallel udev reloads during device add
litest_add_device and litest_delete_device trigger a udev rule reload. This
messes with some test devices and when we run multiple tests in parallel we
get weird errors like "keyboard $BLAH failed the touchpad sanity test".

Still not 100% reliable to run tests in parallel, but it's vastly improved
now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-07-05 11:28:43 +10:00
Peter Hutterer
b5ea413724 test: fix a memleak when creating udev devices
If the first device we got didn't have the expected syspath we'd leak the
device and cause the valgrind tests to fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-05 11:14:39 +10:00
Peter Hutterer
35a6ebc536 Merge branch 'wip/tablet-pad-modes-v3' 2016-07-04 10:26:03 +10:00
Peter Hutterer
0526044f6d touchpad: remove software middle button when emulation is enabled
Expose the middle button emulation on software buttons as proper config
option. When enabled, remove the middle button software button area.

https://bugs.freedesktop.org/show_bug.cgi?id=96663

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-04 09:41:33 +10:00
Peter Hutterer
4923c404e8 gestures: make the gesture movement threshold depending on finger count
Increase the mm move threshold for 3 and 4 finger gestures to 2 and 3 mm,
respectively. In multi-finger gestures it's common to have minor movement
while all fingers are being put down or before the conscious movement starts.
This can trigger invalid gesture detection (e.g. a pinch instead of a swipe).
Increase the movement threshold to make sure we have sufficient input data.

No changes to 2-finger movements.

https://bugs.freedesktop.org/show_bug.cgi?id=96687

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-04 07:42:54 +10:00
Peter Hutterer
30bc86f47e test: add pad mode group tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-24 13:29:18 +10:00
Peter Hutterer
d520c5bb84 test: add an Wacom EKR test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-24 13:29:18 +10:00
Peter Hutterer
6583f4bb53 pad: Add a new API for modes and mode groups
Move mode control to libinput. This reduces some flexibility on what we can do
with modes but makes it a lot easier for anyone to implement modes correctly
and have the LEDs apply appropriately, etc. Let's go with the option to make
the 95% use-case easy. Note: whether the mode is actually used is up to the
caller, e.g.  under Windows and OS X the mode only applies to the
rings/strips, not the buttons.

A tablet pad has 1 or more mode groups, all buttons/ring/strips are assigned
to a mode group. That group has a numeric mode index and is hooked to the
LEDs. libinput will switch the LEDs accordingly.

The mode group is a separate object. This allows for better APIs when it comes
to:
* checking whether a button/ring/strip is part of a mode group
* checking whether a button will trigger a mode transition

and in the future potentially:
* checking which mode transition will happen
* setting which button should change the mode transition
* changing what type of mode transition should happen.
* moving a button from one mode group to the other

This patch adds the basic scaffolding, without any real implementation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Proofread-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-22 11:57:07 +10:00
Peter Hutterer
28f75d9f9d Merge branch 'wip/touchpad-drop-hysteresis' 2016-06-20 09:26:44 +10:00
Peter Hutterer
48473994c8 touchpad: re-enable hysteresis by default for all devices
The removal of the hysteresis even on precise touchpads has led to
difficulties controlling the cursor in a few instances. Since 27078b2667
we only have the hysteresis on Apple touchpads and the Lenovo *40 series and
later. Even on those do we see some positioning difficulties (bug 94379).

So restore the hysteresis by default again for all touchpads. In the future a
knob could be exposed for precision vs reactivity or something, but for now
the drawback of imprecise positioning does not outweigh the benefits we get
on those few devices.

https://bugs.freedesktop.org/show_bug.cgi?id=94379

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:23:58 +10:00
Peter Hutterer
89747d7143 Revert "touchpad: reset the motion history on significant negative pressure changes"
We will reinstate the hysteresis for all devices making the negative
pressure check unncessary.

This reverts commit ef48c07a96.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:23:51 +10:00
Peter Hutterer
dd73c5391e Revert "test: add a test for the T450 dropped motion events"
This reverts commit b5527fa4c7.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:23:40 +10:00
Peter Hutterer
9bb0cfd878 test: add an apple magicmouse device
This device has a touchpad on the mouse but it's labeled as mouse. For litest
we only label it as LITEST_MOUSE feature and test the touchpad directly on the
device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:17:38 +10:00
Peter Hutterer
5f55d71774 test: when creating an abs test device, force the abs->value to the mimimum
Otherwise the abs->value could lie outside the [min, max] range of the axis.
This isn't much of an issue for actual axes but in the case of ABS_MT_SLOT
(value 47) it causes errors when libevdev sanitises the event into the allowed
slot range.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:17:38 +10:00
Peter Hutterer
b2cd0c27bb test: make the valgrind target depend on 'all'
Make sure we rebuild before running valgrind, everything else is a waste of
time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-16 12:09:25 +10:00
Peter Hutterer
7860a9ed77 touchpad: stop palm detection when a second finger is detected
This avoids accidental palm detection during two-finger scrolling if one
finger is inside the edge exclusion zone.

Palm detection is designed to avoid accidental touches while typing. If a
non-palm finger is on the touchpad already the user is unlikely to be typing.
So stop palm detection in this case and process the fingers as normal.

This implementation has a minor bug: if both palm touches start within the
palm exclusion zone within the same frame, neither will be labelled as palm
due to how we check the other touches. Since this is an extremeley niche case
we can live with that.

https://bugs.freedesktop.org/show_bug.cgi?id=95417

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-15 10:23:18 +10:00
Peter Hutterer
8cf2b5f8a3 test: start the pad button tests at BTN_0
Oops, we didn't actually check the button mapping for most pads...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-08 11:38:22 +10:00
Peter Hutterer
27078b2667 touchpad: restore the hysteresis by default
A large part of the bugs seen right now are related to touchpads jittering too
much. Fixing them one by one is entertaining, but time consuming. Right now
the number of touchpads that require a hysteresis seem to outnumber those that
don't, so switch the approach around: leave the hysteresis in place but
disable it for those touchpads that don't need it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-06 09:00:14 +10:00
Peter Hutterer
cf707baace tablet: up the reference count for the tool in the event
Make sure that the tool is valid while the event is valid, even if the device
gets destroyed before the event is destroyed.

This cannot actually be triggered right now, the event has a ref to the device
and the tools do not get removed until the device is destroyed. But for future
implementations (e.g. where the tool is otherwise automatically destroyed on
proximity out) we need to ensure the tool remains valid for the event
lifetime.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30 16:10:12 +10:00
Peter Hutterer
41b9078eec test: skip manually setting uinput resolution if it's already set
If we have libevdev 1.5 or later, the resolution is already set, no need to
change it again. Let's rely on libevdev to do the right thing and simply skip
the rest if we have one correct nonzero resolution already set on the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-20 09:58:19 +10:00
Peter Hutterer
f6fc03ab12 test: fix a couple of touchpad tests that triggered the cursor jump warning
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-19 09:06:36 +10:00
Peter Hutterer
8527242ed9 evdev: the range between dpad and trigger-happy are keys, not buttons
Affected keys:
	KEY_ALS_TOGGLE
	KEY_BUTTONCONFIG
	KEY_TASKMANAGER
	KEY_JOURNAL
	KEY_CONTROLPANEL
	KEY_APPSELECT
	KEY_SCREENSAVER
	KEY_VOICECOMMAND
	KEY_BRIGHTNESS_MIN
	KEY_BRIGHTNESS_MAX
	KEY_KBDINPUTASSIST_PREV
	KEY_KBDINPUTASSIST_NEXT
	KEY_KBDINPUTASSIST_PREVGROUP
	KEY_KBDINPUTASSIST_NEXTGROUP
	KEY_KBDINPUTASSIST_ACCEPT
	KEY_KBDINPUTASSIST_CANCEL

https://bugs.freedesktop.org/show_bug.cgi?id=95295

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-17 07:58:15 +10:00
Peter Hutterer
fb5a97211b test: add a keyboard test device with all codes enabled
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-17 07:58:15 +10:00
Peter Hutterer
d1a8a92184 Add support for relative device rotation (trackball only)
Trackballs are effectively stationary devices and can be positioned at any
rotation. They are also employed by users with impaired dexterity which
sometimes implies that they are positioned at an non-default angle to make the
buttons easier to reach.

Add a config option for rotation for trackball devices. Currently only
supported for 90-degree angles, if there is a need we can add more angles
later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-16 09:21:38 +10:00
Peter Hutterer
8a415e486a Add tagging of trackballs
Currently unused, but oh, the possibilities...

The only thing we have to go on for trackballs at the moment is whether they
have "Trackball" in the name string. All others need to be manually tagged.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-03 17:17:28 +10:00