Commit graph

1460 commits

Author SHA1 Message Date
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
4eb29a8cc5 switch: hook up to keyboard events to fix the lid switch state
Extra insurance against broken lid switches. Listen to events from the
(internal) keyboard when we are logically closed. If any, assume we're open
after all and update accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:44:04 +10:00
Peter Hutterer
5f2402a41a switch: only sync the initial state if we know the state is reliable
This changes the default behavior to "disable the touchpad on the first lid
close event", thus filtering any laptops where the switch state is buggy and
always in "on" state. Devices where we know the lid switch state is
reliable can be marked as such.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:44:04 +10:00
Peter Hutterer
2a1ed92c51 switch: sync the initial state of the switch on startup
This is the default behavior, based on the theory of hardware actually doing
the right thing. That's not always the case, follow-up patches will change
when we do the theoretically ideal thing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:44:04 +10:00
James Ye
a817098fcb test: add tests for lid switch
Ship a custom udev rule for the test device until systemd v333 is commonplace.

Signed-off-by: James Ye <jye836@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:44:04 +10:00
James Ye
1f0223e9fd Add a "switch" interface for parts of the SW_* range
This will allow switch devices known to libinput to be exposed. Currently,
this is SW_LID.

libinput also handles switch events internally, e.g. a laptop touchpad will
be disabled autmoatically when the lid is closed. This is transparent to
the caller, although the caller will also receive the event. See
https://bugs.freedesktop.org/show_bug.cgi?id=86223
This features is intended to be the main driver for the interface.

Co-Authored-By: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: James Ye <jye836@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:44:04 +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
Peter Hutterer
43ba2dbb30 touchpad: add a model tag to mark touchpads with visible marker
We used to mark dell touchpads this way but let's make this more generic.
Nothing else used the dell touchpad model flag, so we can simply replace it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-11 10:39:05 +10:00
Peter Hutterer
7b3e583abe Remove a couple of double semicolons
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-11 10:38:52 +10:00
Peter Hutterer
172b45d255 test: swap order for selftest and test suite
Making sure the test suite behaves as expected should be done before we use
it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-10 13:44:15 +10:00