summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2017-06-26test: strdup the suite and test namePeter Hutterer1-10/+40
The check framework takes and stores the pointer and expects it to be live for the livetime of the test but it doesn't strdup it. We have to keep those pointers around ourselves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-26touchpad: ignore the tap motion threshold if fingers > slotsPeter Hutterer1-0/+54
Do so on the synaptics serial touchpads at least, they're known to cause cursor jumps when the third finger is down. Not detecting a tap move means three-finger taps get more reliable on these touchpads. This change affects gestures who now effectively have to wait for the tap timeout to happen. It's a trade-off. https://bugs.freedesktop.org/show_bug.cgi?id=101435 https://bugzilla.redhat.com/show_bug.cgi?id=1455443 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-22test: remove duplicate testPeter Hutterer1-1/+0
Copy/paste error, no functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-19touchpad: use the "is internal keyboard" tag to enable dwtPeter Hutterer1-70/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-13test: decouple our tests/test suites from the ones used by checkPeter Hutterer1-73/+62
Check arranges the tests into suites and test cases (which then can have multiple test functions). The primary feature for suites is the ability to select them with environment variables and that the log messages are printed per suite, not per test case. We used the suites to distribute tests across the processes forked by the test runner, but that also resulted in slow suites relying on timeouts (tap/dwt) to take a lot longer than other suites and hold everything else up. This patch basically drops the use of check test suites. Our test runner has a --filter-group argument which selects on suite names, the log messages are more useful if they immediately include the device and the test case name. So we just save the test metatdata in our own struct and then assemble a suite/test case on the fly for each test. The advantage of this is that tests of the same suite are now distributed across the forks so slow tests that rely on length timeouts are now run in parallel. This brings the test runs down to under 6 min again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-09test: localise the open/close function counter in the path testsPeter Hutterer1-68/+69
Reduces the chance of interference between tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-09test: use unique names for all the test suite namesPeter Hutterer1-9/+16
This makes it possible to run multiple test suite simultaneously on the same host without messing up the other runs (provided that all instances use the same udev/hwdb files). Previously, removing the udev rules/hwdb at the end of a test run would cause test case failures in other runs that hadn't completed yet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-06-07test: remove unused devices field from struct testPeter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02test: remove unused litest_handle_eventsPeter Hutterer2-17/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02test: limit the wait_for_event timeout to 2sPeter Hutterer1-2/+2
No internal timeout we have takes longer than 2s, so we can abort if we don't succeed. This gives us a better backtrace to figure out where we're hanging than the SIGABRT that check will eventually send us. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02test: don't leak test warnings to stdoutPeter Hutterer4-14/+19
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-01test: drop two superfluous empty queue checksPeter Hutterer1-2/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-01test: tighten some test casesPeter Hutterer2-21/+44
Instead of just waiting for events, use a libinput_dispatch() and assume the event is there when we want it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-01test: add an extra assert into litest_wait_for_event_of_typePeter Hutterer1-1/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-01test: make sure we search for event node, not the parent input devicePeter Hutterer1-1/+3
This explains the heisenbugs when running the test suite. libevdev gives us the syspath to the /sys/.../input123 node, not the one for the event node. The device node path is created based on the sysfs tree, so there's a window where the device node may not exist yet but we already returned the device node path. In litest, we're using a udev monitor to wait until the device is ready for us, but the path interface only takes a device node path. So what happens is: * libevdev gives us a syspath for the input node and a device path * the monitor receives the input node udev device and matches the syspath * we pass that up to the caller litest_add_device_with_overrides() which opens the device node and adds it to libinput * the path interface creates a udev device from the device node, which still points to the old device node. Things fail because we don't have the device we expect or it doesn't send events and eventually times out [1]. The errors triggered by this are either odd udev property mismatches or timeouts because events are never processed. This race is fixed by simply constructing the actual device node path we expect from the udev device and waiting for the right device. [1] We rely on the caller to notify us when to remove the device and thus silently ignore ENODEV. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-23Revert "lid: force the lid to open when the keyboard device is removed"Peter Hutterer1-36/+0
This reverts commit 1e2b66fb9a0de8956abc7d996afdd24a11893eb6.
2017-05-23lid: force the lid to open when the keyboard device is removedPeter Hutterer1-0/+36
On unreliable tablets (Surface3), always force the lid switch to open when the paired keyboard is removed. This way the lid can't be stuck in a closed state when there's nothing attached that can actually trigger that state. https://bugs.freedesktop.org/show_bug.cgi?id=101100 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-23lid: setup the keyboard notifier when pairing itBenjamin Tissoires1-0/+51
On unreliable LID switches, we might have the LID declared as closed while it is actually not. We can not wait for the first switch event to setup the keyboard listener: it will never occur. https://bugs.freedesktop.org/show_bug.cgi?id=101099 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-23test: tighten the wakeup-on-key lid testPeter Hutterer1-1/+0
Having a litest_wait_for_event_of_type() in there causes us to silently discard anything but the events we're looking for. This is risky, we want to make sure that if we re-enable the lid that the key events arrive *after* the lid open event, not before. So let's not paper over those. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-23test: fix a lid testPeter Hutterer1-1/+1
We were checking for the empty queue on the wrong context, the default context got drained a few lines above. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-15test: make the initial copy file error messages more sensiblePeter Hutterer1-2/+8
This is most likely the first error message a developer encounters when running the test suite and the /run/udev/rules.d directory already exists. Make it more meaningful than the current generic integer comparison failure. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-15test: don't use ck_abort_msg outside of test runsPeter Hutterer1-4/+4
This function used to be called inside a test run a long time ago but moved to a pre-setup stage without switching to the more generic litest_abort_msg. The only error message we got is "check_msg.c:80: No messaging setup". https://github.com/libcheck/check/issues/18#issuecomment-301217615 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-11test: install the litest device groups filePeter Hutterer2-1/+9
We never installed the device groups file for the tests, effectively relying on a system copy to be installed already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-11touchpad: pull the tap exclusion zone down to the full edge zonePeter Hutterer1-4/+4
This was originally left outside of the button areas in case users tap in those zones, but we're getting false tap events in that zone. On a 100mm touchpad, the edge zone is merely 5mm, it's acceptable to ignore taps in that area even in the software button. We can revisit this if we see tap detection failures in the future. https://bugzilla.redhat.com/show_bug.cgi?id=1415796 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-05-08test: suppress Python3 valgrind errorsPeter Hutterer1-0/+6
Running through mesontest also runs parse-hwdb through valgrind and gives us a bunch of leaks that originate within Python somewhere - we don't care about those. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-08test: disable coredumps during test suite runsPeter Hutterer1-0/+5
Running valgrind through mesontest produces coredumps for a lot of tests (unclear why, the core dump merely shows a call to abort). But even without mesontest, creating a core dump for each failed test is a bad idea - if one fails, most likely many others fail and the coredumps quickly fill up the file system. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-05lid: remove the keyboard listener on remove and re-init the listenerPeter Hutterer1-0/+30
If the event listener is added, then removed again on a lid switch on/off event, the list is set to null. This can trigger two crashes: * when the keyboard is removed first, the call to libinput_device_remove_event_listener() dereferences the null pointer * when the switch is removed first, the call to device_destroy will find a remaining event listener and assert https://bugzilla.redhat.com/show_bug.cgi?id=1440927 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-05touchpad: remove the lid switch listener on device_removedPeter Hutterer1-0/+26
Sequence triggered by the xorg driver, but basically: if the touchpad is destroyed before the lid switch, the event listener wasn't removed and an assertion was triggered. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-04test: switch from #ifdef to #if HAVE_LIBUNWINDPeter Hutterer1-1/+1
We use #if everywhere else and it allows building with '-Wundef -Werror=undef' to avoid accidental misuse. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-04test: allow running the symbols-leak-test.in script directlyPeter Hutterer1-2/+13
With autotools, we replace the @top_srcdir@ during configure and then run teh resulting scripts. With meson, it's easier to just pass top-srcdir it in as argument. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2017-05-04test: fix compiler warningPeter Hutterer1-1/+2
test-tablet.c: In function ‘proximity_in_out’: test-tablet.c:797:20: warning: increment of a boolean expression [-Wbool-operation] have_tool_update++; And tighten the test so we fail for multiple prox in events Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-04test: undef ck_assert_double before redefining itPeter Hutterer1-0/+7
check 0.11 has those macros, but they don't work the same way as our homemade ones. So for now just #undef them Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-28touchpad: for 2/3-finger tap, use the last finger down as press timePeter Hutterer1-0/+56
This makes the tapping times shorter and hopefully more obvious. It also fixes a bug where repeated tripletap (by tapping with one finger while leaving the other two down) could cause incorrect timestamps. https://bugs.freedesktop.org/show_bug.cgi?id=100796 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-28touchpad: send multitap button events with the correct timestampsPeter Hutterer1-3/+58
For multitap, we're one tap behind with the button clicks, i.e. we send the first full click button on the second tap, etc. Remember the timestamps of the touches so we can send the events with the right timestamps. This makes tapping more accurate because the time between taps and various timeouts matter less for double-click detection. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-28test: enable drag lock for multitap testsPeter Hutterer1-0/+5
Without this enabled, we stay in the single/double tap part of the state machine and a triple tap is just a double tap followed by a single tap. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-28touchpad: fix the button timestamps for double/tripletapPeter Hutterer1-16/+52
Both events had the same timestamp but we have the timestamp from the original event - use it. https://bugs.freedesktop.org/show_bug.cgi?id=100796 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26Merge branch 'wip/touchpad-custom-pressure-values'Peter Hutterer1-0/+43
2017-04-26touchpad: move the pressure range to a hwdb entryPeter Hutterer1-0/+43
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26Merge branch 'wip/touchpad-mt-tool-palm'Peter Hutterer1-0/+83
2017-04-24evdev: improve default scroll button detectionPeter Hutterer1-0/+4
Try to guess the default scroll buttons a bit better. Right now we default to scroll button 0 (disabled) whenever a device doesn't have a middle button but we might as well cast a wider net here as setting a scroll button only has a direct effect when button scrolling is enabled. Use the first extra button we find or fall back onto the right button if we don't have any extra buttons. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-21touchpad: add MT_TOOL-based palm detectionPeter Hutterer1-0/+83
If the touchpad driver tells us something is a palm, go with that. https://bugs.freedesktop.org/show_bug.cgi?id=100243 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-30test: unset MOUSE_DPI for the apple magic mousePeter Hutterer1-0/+19
As of systemd commit f013e99e160f385a0c02793c612ef4c8a8ffc4d7, ID_BUS is now set for all bluetooth devices, not just those with subsystem bluetooth. This affects the Apple Magic Mouse and sets the systemd hwdb's MOUSE_DPI value. That value is different to the test results we currently have, causing some tests to fail because different deltas are generated (e.g. pointer_scroll_button). Our udev rules are prefixed 99 and thus apply after the various system rules. So we can't easily set ID_BUS in our rule because it'll apply after 70-mouse.rules checks for the bustype. So we'd have to detect systemd version or so, but the easy way is to simply force MOUSE_DPI to the empty value. For our test cases it doesn't matter if the DPI is set correctly anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-30test: fix udev rule for click count devicePeter Hutterer1-3/+3
Assigned click counts to other, unrelated devices Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28test: highlight the various state machines with colorsPeter Hutterer1-1/+20
Makes visual identification easier Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28test: detect linebreaks in log messagesPeter Hutterer1-4/+6
If a single log message is composed of multiple calls (as are all from evdev_log_*), don't prefix multiple times. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28test: add color to litest verbose outputPeter Hutterer1-4/+25
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28test: align litest output messagesPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28test: drop unused variablePeter Hutterer1-4/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-23tablet: add axis smoothingPeter Hutterer1-7/+71
Taking the tablet events as-is produces the occasional wobble in what should be a straight line. Bug 99961 has a jpg attachment to illustrate that. Emulate the wacom driver behavior and average x/y across the last 4 values to smoothen out these dents. https://bugs.freedesktop.org/show_bug.cgi?id=99961 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-14test: add missing linebreak to error messagePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>