summaryrefslogtreecommitdiff
path: root/test/test-quirks.c
Commit message (Collapse)AuthorAgeFilesLines
* util: auto-declare the element variable in ARRAY_FOR_EACHPeter Hutterer2022-03-091-18/+0
| | | | | | | All cases we have in our code base have an otherwise unused variable to loop through the array. Let's auto-declare this as part of the loop. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: Add test for parsing of boolean quirk attributes.Quytelda Kahja2021-07-301-0/+44
| | | | Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
* test: drop the custom group namesPeter Hutterer2021-02-121-56/+56
| | | | | | | | | | | | | | 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 d838e3a3a4c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: plug a memleak in a quirks testPeter Hutterer2020-12-091-0/+1
| | | | | | Introduced in 56f4af51eca4ceec30e382d0d7c9972a57fd1aa2 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add a test for model quirk overridesPeter Hutterer2020-12-081-0/+50
| | | | | | Related to #545 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: rename the alps touchpad quirk to note it's a serial TP quirkPeter Hutterer2020-03-051-1/+1
| | | | | | | This quirk only applies to serial ALPS touchpads, so let's name it accordingly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: fix a coverity complaintPeter Hutterer2020-03-021-0/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: add trackpoint integration attributePeter Hutterer2019-05-281-0/+34
| | | | | | | | | | | | | | 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>
* test: Clean up memory leaksJason Gerecke2019-04-111-0/+1
| | | | | | | | 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>
* quirks: don't allow single quotes for valuesPeter Hutterer2018-08-131-0/+42
| | | | | | | 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>
* tests: more tests for quirks handlingPeter Hutterer2018-08-131-0/+66
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add tests for successful/failing parsing of various quirksPeter Hutterer2018-08-131-0/+317
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: fix quirks test for invalid bus type matchesPeter Hutterer2018-08-131-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: release a few leaking udev devicesPeter Hutterer2018-07-261-0/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add a libinput-test runner for 'deviceless' testsPeter Hutterer2018-06-261-34/+34
| | | | | | | | | | 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>
* test: quirks: init value to avoid valgrind errorsPeter Hutterer2018-06-251-4/+4
| | | | | | | 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>
* test: init test quirks in /tmp, not /runPeter Hutterer2018-06-251-1/+1
| | | | | | We don't need to be root to write to tmp Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: don't require a device for quirks parsing testsPeter Hutterer2018-06-221-34/+34
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: add MatchVersion in addition to VID/PIDPeter Hutterer2018-06-181-0/+63
| | | | | | | | 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>
* test: switch the udev tag tests to be quirk testsPeter Hutterer2018-06-081-0/+83
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: allow for in-line commentsPeter Hutterer2018-06-081-0/+64
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Implement a quirks system to replace the udev property parsingPeter Hutterer2018-06-081-0/+809
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>