Commit graph

863 commits

Author SHA1 Message Date
Peter Hutterer
9e8f6bd1d6 test: add touchpad pressure tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
568d527caa touchpad: use pressure values for touch is-down decision
Don't rely on BTN_TOUCH for "finger down", the value for that is hardcoded in
the kernel and not always suitable. Some devices need a different value to
avoid reacting to accidental touches or hovering fingers.

Implement a basic Schmitt trigger, same as we have in the synaptics driver. We
also take the default values from there but these will likely see some
updates.

A special case is when we have more fingers down than slots. Since we can't
detect the pressure on fake fingers (we only get a bit for 'is down') we
assume that *all* fingers are down with sufficient pressure. It's too much of
a niche case to have this work any other way.

This patch drops the handling of ABS_DISTANCE because it's simply not needed
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
2b3fe1a73e test: add the right pressure bits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
c27f9afffc test: make sure touch up resets pressure
Should be overridden by the test devices where something more fine-grained is
needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
8dfdf6b76f test: switch the semi-mt devices to use the litest semi-mt handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:44:04 +10:00
Peter Hutterer
cef3a8705e test: handle semi-mt devices in litest
Don't rely on the devices to handle themselves, just handle it globally

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:45 +10:00
Peter Hutterer
72ac3c1aee test: convert event handling while loops into for loops
No functional changes, just enables us to use 'continue' instead of piling up
negated conditions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:02 +10:00
Peter Hutterer
11b37080df test: allow nesting of litest_push_event_frame()
Right now, we fail if we call litest_push_event_frame() when already inside a
frame. For the semi-mt handling we need to do exactly that though, so turn it
into a counting semaphore instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:02 +10:00
Peter Hutterer
3170b3519b touchpad: ignore hovering touches when tapping
We need to remember whether a tap was down or just hovering, otherwise we mess
up the state machine when we send tap release events for taps that never
switched to TOUCH_BEGIN. This is quick fix, really we should have a new state
here, but that's a lot harder to implement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:02 +10:00
Peter Hutterer
618ee6ac94 test: force a pressure of 0 when we hover a touch
As we switch to pressure-based touch detection, we need for all
pressure-capable touchpads to send pressure values. They'll do so by filling
in an axis default but that breaks our current hover code.

Make sure the hover litest helpers force a pressure of 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:01 +10:00
Peter Hutterer
7c8cecdb02 test: add two more touch..._extended functions
So we can set pressure during touch sequences

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:01 +10:00
Peter Hutterer
ebeba8e8ff Merge branch 'wip/wheel-tilt-source' 2017-01-20 12:51:53 +10:00
Peter Hutterer
dbb376f74b test: add wheel tilt tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-20 11:45:29 +10:00
Peter Hutterer
aba825658b test: add test to set tap map on unsupported devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
35421834c7 test: check the pad button state in litest_is_pad_button_event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
7fe7f50a37 test: add tests for tablet buttons and button seat count
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
20b354449f test: add more tests for tap-drag config
Including one to get/set it on unsupported devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
44fe6f6312 test: ad calls to check whether pressure has changed
Nothing actually called that function, sprinkle a few calls into existing
tests to make sure it actually works.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
96f0140749 test: test absence of scroll events on keyboards
Executes the paths to set invalid scroll methods.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
989113cdb9 test: add device size/no size checks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
db0f84b3ce test: add a test for the tool ID
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
a7f4939f91 test: add a test for tablet pad event timestamps
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
dbeaa06712 test: add test for tablet_tool_get/set_user_data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
d9f09cec76 test: add a tablet tool capability check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
4e7db651ce test: add a test to force a destroy for the path backend
The test suite (and tests) we have now all clean up nicely before calling the
final libinput_unref(). Add one where there's at least one device still
connected.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
b887ddc756 test: add some device capability checks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
0d09791afb test: add test for fetching invalid pointer axes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
a1a10242bd test: test for libinput_device_get/set_user_data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
66d12ac8ff test: add tests for checking for buttons for a non-pointer device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
9ab8e7f783 util: make all property parsing helpers ignore NULL strings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
7c6784dd81 test: add test for invalid path operations on udev backends
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
0a34ed409e test: add test for invalid udev_assign_seat on path context
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
fcddfc6b11 test: add helper function to install a "bug expected" log handler
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
50dfd52cd7 test: add a test for keyboard LED updates
Not much we can check for here anyway, but at least we can trigger the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
a87e2558cf Hook up gcov for coverage reports
./configure --enable-gcov adds the required flags to link everything ready for
gcov. A new make gcov target runs the test suite, then pulls all the gcov bits
together into ./test/gcov-reports/ including a summary file.

The script to pull everything out is used in libevdev too, we just have an
extra condition here to ignore the selftest gcov bits (it overwrites the
useful litest.c coverage output).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:37 +10:00
Peter Hutterer
a04ba9a276 test: check if left-handed is available for the left-handed tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
1dccc4fdff test: fix some tablet tests' unreached code
These conditions were never triggered by our test suite, so let's tighten up
the tests to match what we expect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
4d20130e05 test: fix pointer accel defaults test
Loop immediately exited, this code was never triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
9483a7a2c0 test: simplify some checks in the path test
The first event is always a device added event, skip the loops that would
paper over this. If we ever change this, the tests *should* fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
a9016f7e15 test: remove some untriggered code from the keyboard tests
The second condition was never triggered because we shouldn't get anything but
keyboard events here. Drain the initial event burst and remove the two
skipping conditions that won't happen anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
1019a1703d test: rename wacom test devices to a consistent naming scheme
Use the model names in the file name and append pad/pen/finger as appropriate

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 12:11:19 +10:00
Peter Hutterer
6fb1348765 Revert "Remove the workaround for libevdev pre 1.3"
I'm using semaphore CI for build testing and that only provides Ubuntu 14.04
which doesn't have libevdev 1.3 or later.

Since this is a minor workaround for an error case only, revert the commit
again and leave the handling in. Less effort than having to patch around it in
semaphore.

This reverts commit 1e0736daf3.
2017-01-16 10:24:02 +10:00
Peter Hutterer
0269e3b092 test: remove tablet axis normalization test
gcov analysis showed that none of the actual testing conditions were hit, so
the test succeeded despite not actually testing anything. Which is good,
because testing for tilt normalization isn't correct anyway, tilt is in
physical degrees,

Drop the test and replace it with a test for pressure normalization instead.
We already have a similar one to check for [0, 1] range, this new one
explicitly tests for the extents.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 09:11:41 +10:00
Peter Hutterer
86c2e56132 test: fix a comment regarding uinput's resolution assignment
This isn't true anymore with kernel 4.5 and libevdev 1.5.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:32 +10:00
Peter Hutterer
1e0736daf3 Remove the workaround for libevdev pre 1.3
1.3 has been out since Sep 2014, that's enough time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:32 +10:00
Peter Hutterer
5d66edc9f4 test: prefix all test source files with "test-"
They weren't originally prefixed but the various tests were, but now that we
only have one test runner binary anyway, the prefix helps sorting the files
easily within e.g. gcov results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:00 +10:00
Peter Hutterer
f4e47aca33 test: use some helper functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 15:07:24 +10:00
Peter Hutterer
7bb0d62a65 test: fix some empty queue handling
Use the litest_assert_empty_queue() instead of manual checking, and remove the
manual checks after the function call.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 15:06:52 +10:00
Peter Hutterer
ba996a06c5 test: skip a few unnecessary base event conversions
These were just there so we didn't have an unused variable warning, but
there's no reason even assigning to anything in the first place

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 15:06:48 +10:00
Peter Hutterer
a294cf4f90 test: add a synaptics RMI4 test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 14:45:50 +10:00