summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2018-07-26test: properly release a few leaking litest devicePeter Hutterer2-2/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-26test: release a few leaking udev devicesPeter Hutterer2-2/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-26test: supress another bash warningPeter Hutterer1-0/+6
Failing the leftover-rules check in the valgrind stage because ==1491== Invalid read of size 16 ==1491== at 0x5320AE8: __wcsnlen_sse4_1 (in /usr/lib64/libc-2.27.so) ==1491== by 0x5310AD1: wcsrtombs (in /usr/lib64/libc-2.27.so) ==1491== by 0x1AA403: ??? (in /usr/bin/bash) ==1491== by 0x1AB3E3: glob_filename (in /usr/bin/bash) ==1491== by 0x179FF1: shell_glob_filename (in /usr/bin/bash) ==1491== by 0x1752CD: ??? (in /usr/bin/bash) ==1491== by 0x14C05F: ??? (in /usr/bin/bash) ==1491== by 0x14E2E3: execute_command_internal (in /usr/bin/bash) ==1491== by 0x14FBC5: execute_command (in /usr/bin/bash) ==1491== by 0x137598: reader_loop (in /usr/bin/bash) ==1491== by 0x135D38: main (in /usr/bin/bash) ==1491== Address 0x5651fd0 is 32 bytes before a block of size 128 in arena "client" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-19Add versionsort testGreg V1-0/+18
And make local versionsort testable even when the native one is present.
2018-07-16test: ptrace compatibility with *BSDGreg V1-3/+3
2018-07-16test: use simple portable sendfileGreg V2-2/+9
There's no need for high performance in these little tests, so instead of supporting various platform-specific sendfile() implementations, just use a local read-write function.
2018-07-16test: support disabling tty on FreeBSDGreg V1-2/+28
Instead of K_OFF, use K_RAW plus termios raw mode. (Same approach as in the Weston patches)
2018-07-16test: remove unsupported events from the invalid-range touchscreen test devicePeter Hutterer1-6/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-16test: remove unused values.h includeGreg V1-1/+0
2018-07-13Rename data/ to quirks/Peter Hutterer1-7/+9
A better, less ambiguous name than just "datadir" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-12test: tidy up the symbols leak testPeter Hutterer2-28/+18
This hasn't been a real .in file since the autotools removal, so rename it to reflect that. And since we can call it with arguments from meson, let's do so in the most sensible manner - passing the full paths in as required rather than relying on a directory layout within the script. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-05test: misc: up the time limit on the ratelimit testsPeter Hutterer1-4/+4
I keep hitting this in the gitlab runner, 100ms is clearly not enough here for slow containers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-29fallback: cancel the debounce timers during device remove, not destroyPeter Hutterer1-0/+54
destroy isn't called until the last libinput_device_unref(), so we may trigger a debounce timer after the device was removed. The same fix is neded for the touchpad interface. Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/72 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26test: parse arguments before any other stuffPeter Hutterer1-8/+8
If the args are bad, we don't need to check for root and whatnot. Only exception here is the debugger check because it changes defaults that we may want to override with commandline arguments later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26touchpad: don't disable tapping on MT_TOOL_PALMPeter Hutterer1-0/+43
The tapping code can handle palm states now, so there is no need to disable tapping altogether when a tool-based palm is detected. Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/65 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26test: add a libinput-test runner for 'deviceless' testsPeter Hutterer5-89/+182
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-25test: switch the global device list to a struct listPeter Hutterer2-53/+45
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-25test: fix indentation in litest-int.hPeter Hutterer1-25/+25
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-25test: quirks: init value to avoid valgrind errorsPeter Hutterer1-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>
2018-06-25test: if we never installed any udev files, we don't need to reloadPeter Hutterer1-1/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-25test: init test quirks in /tmp, not /runPeter Hutterer1-1/+1
We don't need to be root to write to tmp Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-22test: don't require a device for quirks parsing testsPeter Hutterer1-34/+34
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21test: skip the test-suite runner based on SKIP_LIBINPUT_TEST_SUITE_RUNNERPeter Hutterer1-0/+3
The current /dev/input/* check isn't reliable enough. So rather than adding extra heuristics prone to fail add an environment variable that says "do not run the test suite runner". All other tests are run since they do not require/modify any specific system setup. Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/62 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21test: fix zalloc max size testsPeter Hutterer1-2/+2
Missing from 9873d68bf1f93b424f920a8c095e3d3ee7d3fdf5 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20util: abort if we try to allocate more than a MBPeter Hutterer1-0/+15
The ssize_t cast upsets coverity for some reason but we can be a lot more restrictive here anyway. Quick analysis of the zalloc calls in the test suite show the largest allocation is 9204 bytes. Let's put a cap on for one MB, anything above that is likely some memory corruption and should be caught early. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matheus Santana <embs@cin.ufpe.br>
2018-06-19test: remove a compiler warningPeter Hutterer1-1/+1
Leftover from a previous iteration of this code - having a static but unnecessarily large size for dirname results in: ../test/litest.c:1251:38: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] snprintf(dest, sizeof(dest), "%s/%s", dirname, filename); ^ ../test/litest.c:1251:3: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096 snprintf(dest, sizeof(dest), "%s/%s", dirname, filename); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18test: pass the open mode to open(O_CREAT)Peter Hutterer1-1/+1
Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18Drop the udev hwdb model quirksPeter Hutterer1-10/+0
Replaced with the quirks files in merge commit 000ac14c27f1920fc84c0ecb1512eb7495e67634 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18quirks: add MatchVersion in addition to VID/PIDPeter Hutterer1-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>
2018-06-14test: fix a test device section namePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14test: fix the input_id struct for the ALPS touchpadPeter Hutterer1-1/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-11Merge branch 'wip/config-files'Peter Hutterer17-173/+1327
2018-06-11util: abort for a negative zalloc() sizePeter Hutterer1-0/+10
Nothing in libinput needs large buffers, so if we ever get something that large, we probably passed a negative number to zalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-11util: add null string test handling to strv_joinPeter Hutterer1-0/+3
Make it return NULL for a string array in the form of [ NULL ], like the docs say. This also adds an extra safety check for the joiner to be of a reasonable length to avoid overflows. Found in https://gitlab.freedesktop.org/libinput/libinput/issues/26#note_6320 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08Switch from udev property parsing to the quirks systemPeter Hutterer11-85/+63
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08test: switch the udev tag tests to be quirk testsPeter Hutterer2-85/+83
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08test: init the quirks once per test suite runPeter Hutterer2-0/+30
So we have them available per litest device and can check in tests for certain quirks to be present. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08test: install per-test device quirks filesPeter Hutterer2-0/+87
These will replace the custom udev rules we currently have in place. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08quirks: allow for in-line commentsPeter Hutterer1-0/+64
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08Implement a quirks system to replace the udev property parsingPeter Hutterer1-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>
2018-06-08util: add a safe_atou() as unsigned equivalent to safe_atoi()Peter Hutterer1-0/+115
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08util: add a list_append()Peter Hutterer1-0/+64
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08test: remove created directories tooPeter Hutterer1-0/+2
If we created it, remove it again. No change because we're not adding any of the directories yet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08test: make litest_copy_file copy normal files tooPeter Hutterer1-3/+10
Make the tempfile creation dependent on whether the required template is present. Currently unused, this is just prep work for future patches. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-31udev: drop the JUMPING_SEMI_MT quirk, no-one uses itPeter Hutterer1-10/+0
Obsolete since 342bc510164e89d7c9a742406fb98f9deabf5c8f when we disabled MT on all semi-mt touchpads. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-30tablet: increase the proximity timeout during test runsPeter Hutterer1-1/+1
This is causing too many false positives and they're not easy to filter out. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-25test: fix udev prop test for apple touchpadsPeter Hutterer1-2/+2
Clearly a copy/paste error. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-25test: fix udev rule for the gpio keys test devicePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21Revert "touchpad: allow custom profiles on touchpads"Peter Hutterer1-29/+23
This reverts commit f6d61dc3147c2df297c117a23752c332abdb1288.
2018-05-18test: fix the udev rule for the HP WMI hotkeys devicePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>