Commit graph

21 commits

Author SHA1 Message Date
Quytelda Kahja
e8bcf71c69
test: Add test for parsing of boolean quirk attributes.
Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
2021-07-30 06:11:20 -07:00
Peter Hutterer
d3115f4875 test: drop the custom group names
The group names are forced by check (they are called suite names there) but
for our test suite they provide very little benefit. Much easier to just
use the filename a test is in as group name.

This removes the pure substring match for --filter-group, it's now fnmatch
only. group names are short enough that the typing isn't an issue and we don't
want to run tests twice (e.g. 'pad' is also in 'touchpad').

This patch caused #574 until it got fixed in d838e3a3a4

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-12 15:24:15 +10:00
Peter Hutterer
61d3427635 test: plug a memleak in a quirks test
Introduced in 56f4af51ec

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-12-09 21:22:32 +10:00
Peter Hutterer
56f4af51ec test: add a test for model quirk overrides
Related to #545

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-12-08 09:59:03 +10:00
Peter Hutterer
c7f06b0bdd quirks: rename the alps touchpad quirk to note it's a serial TP quirk
This quirk only applies to serial ALPS touchpads, so let's name it
accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-05 16:35:53 +10:00
Peter Hutterer
7b94955634 test: fix a coverity complaint
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-02 12:51:15 +10:00
Peter Hutterer
8dfe8c68eb quirks: add trackpoint integration attribute
Some versions [1] of the Lenovo ThinkPad Compact USB Keyboard with TrackPoint USB
have the pointing stick on an event node that has keys but is not a regular
keyboard. Thus the stick falls through the cracks and gets disabled on tablet
mode switch. Instead of adding more hacks let's do this properly: tag the
pointing stick as external and have the code in place to deal with that.

[1] This may be caused by recent kernel changes

Fixes #291

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 13:23:49 +10:00
Jason Gerecke
09e97a5231 test: Clean up memory leaks
A few leaks in the test code were found when running linput-test-suite
with the -fsanitize=address option enabled. Clean up these leaks so that
we can more clearly see real issues.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-11 17:50:09 +10:00
Peter Hutterer
11a5f91bb7 quirks: don't allow single quotes for values
At least not opening single quotes, same as the double quotes we already have.
Add the tests for both.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
41d4ab3d62 tests: more tests for quirks handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
a897fae128 test: add tests for successful/failing parsing of various quirks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
33ac390aa4 test: fix quirks test for invalid bus type matches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
5f589c8582 test: release a few leaking udev devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-26 11:51:21 +10:00
Peter Hutterer
5ca1862bde test: add a libinput-test runner for 'deviceless' tests
These are tests that don't need *any* uinput devices at all. Mark them
accordingly and create a new binary that only runs those tests. This way we
can run some of the test suite even in containers where we're restricted.

Better have 10% tested than none, I guess.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 11:18:31 +10:00
Peter Hutterer
d96494e5a7 test: quirks: init value to avoid valgrind errors
value isn't touched where the quirk doesn't exist, so we're accessing an
uninitialized variable here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-25 11:08:37 +10:00
Peter Hutterer
9d26caa569 test: init test quirks in /tmp, not /run
We don't need to be root to write to tmp

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-25 11:08:37 +10:00
Peter Hutterer
304441df3e test: don't require a device for quirks parsing tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-22 09:34:44 +10:00
Peter Hutterer
a57d35a1aa quirks: add MatchVersion in addition to VID/PID
Needed for the ALPS firmware detection in #39

https://gitlab.freedesktop.org/libinput/libinput/issues/39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 10:34:16 +10:00
Peter Hutterer
12b07229d8 test: switch the udev tag tests to be quirk tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:37:22 +10:00
Peter Hutterer
3ce70cfa91 quirks: allow for in-line comments
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:33:35 +10:00
Peter Hutterer
5792af9a5f Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.

This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.

The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.

Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.

THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:33:35 +10:00