Commit graph

1460 commits

Author SHA1 Message Date
Peter Hutterer
6af06769ad test: skip testing tablet buttons that don't exist on the device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:24:49 +10:00
Peter Hutterer
9b174fc9d8 test: use the litest macros in the tablet button check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:24:49 +10:00
Peter Hutterer
9610ff849e Merge branch 'master' into tablet-support 2015-06-29 13:56:05 +10:00
Peter Hutterer
b344e3e566 touchpad: disable tap drag lock by default
Similar to tapping, it's a feature that is useful but confusing if a user
doesn't know it exists. It makes the touchpad appear laggy and slow to react
in the best case, or appear like a stuck button in the worst case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-29 07:52:41 +10:00
Peter Hutterer
3195b95d1d test: add non-draglock test and rename draglock-dependent tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 14:24:29 +10:00
Peter Hutterer
875e1d1b10 touchpad: hook up drag lock configuration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 14:24:29 +10:00
Peter Hutterer
3fcdba6ca6 test: replace tap config with helper function
No functional change, other than that we check for status codes now too.
In tests that don't specifically check the interface itself, a short
enable_tap() or disable_tap() is a lot more obvious to parse for the reader.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 14:24:29 +10:00
Peter Hutterer
0d322c69d0 Merge branch 'master' into tablet-support 2015-06-22 15:20:01 +10:00
Peter Hutterer
9ad54b85f4 test: drop extra finger up/down in tapndrag + click test
Already tested elsewhere

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-22 10:32:33 +10:00
Peter Hutterer
aa46338e8a touchpad: mark ALPS touchpads for middle button emulation
Alps devices don't know if there is a physical middle button on the touchpad,
so they always report one.
Since a large number of touchpads only have two buttons, enable middle button
emulation by default. Those that really don't want it can play with
configuration options, everyone else has it working by default.

The hwdb entry uses "*Alps ..*" as name to also trigger the "litest Alps..."
devices.

https://bugzilla.redhat.com/show_bug.cgi?id=1227992

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-22 08:12:04 +10:00
Peter Hutterer
56660494ae test: add ALPS DualPoint device
Same as the existing GlidePoint semi-mt device, but this one has a x/y
resolution.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-22 08:08:44 +10:00
Peter Hutterer
51b694e282 touchpad: disable right-edge palm detection for edge scrolling
Most scroll motions would be labelled a palm.

https://bugs.freedesktop.org/show_bug.cgi?id=90980

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-22 08:07:12 +10:00
Peter Hutterer
9c2afae146 test: move tapping tests into a separate binary
The previous set hit _some_ sort of limit, but no idea what or why. When
adding one more test, the touchpad test case would reliably fail with a udev
timeout in litest_wait_for_udev(). This only happened in the valgrind case,
the normal run succeeded. Reproduced on three different installations (2 vms
on two different hosts).

Move the tapping tests into a separate binary, this unwedges whatever was
unhappy and sunshine, lollipops and rainbows are distributed generously.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-22 08:07:07 +10:00
Peter Hutterer
83015f9dca test: switch clickpad multitap to a ranged test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-18 13:36:22 +10:00
Peter Hutterer
aaed6ad8e8 test: fix missing range value when the first test case is a ranged one
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-18 13:36:18 +10:00
Peter Hutterer
b1e7e6fd29 test: replace two asserts with litest_asserts
Having a backtrace is nice

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-18 10:34:11 +10:00
Peter Hutterer
bc9f16b40e COPYING: Update boilerplate from MIT X11 to MIT Expat license
To quote Bryce Harrington from [1]:
"MIT has released software under several slightly different licenses,
including the old 'X11 License' or 'MIT License'.  Some code under this
license was in fact included in X.org's Xserver in the past.  However,
X.org now prefers the MIT Expat License as the standard (which,
confusingly, is also referred to as the 'MIT License').  See
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING

When Wayland started, it was Kristian Høgsberg's intent to license it
compatibly with X.org.  "I wanted Wayland to be usable (license-wise)
whereever X was usable."  But, the text of the older X11 License was
taken for Wayland, rather than X11's current standard.  This patch
corrects this by swapping in the intended text."

libinput is a fork of weston and thus inherited the original license intent
and the license boilerplate itself.

See this thread on wayland-devel here for a discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-May/022301.html

[1] http://lists.freedesktop.org/archives/wayland-devel/2015-June/022552.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
2015-06-16 14:36:04 +10:00
Peter Hutterer
2b99363a1f Merge branch 'master' into tablet-support 2015-06-16 13:52:02 +10:00
Peter Hutterer
8025b374d5 touchpad: set the finger pin distance to 5mm where possible
On touchpads with resolutions, use a 5mm motion threshold before we unpin the
finger (allow motion events while a clickpad button is down). This should
remove any erroneous finger movements while clicking, at the cost of having to
move the finger a bit more for a single-finger click-and-drag (use two fingers
already!)

And drop the finger drifting, it was per-event based rather than time-based.
So unless the motion threshold was hit in a single event it was possible to
move the finger around the whole touchpad without ever unpinning it.

Drop the finger drifting altogether, if the touchpad drifts by more than 5mm
we have other issues.

https://bugzilla.redhat.com/show_bug.cgi?id=1230462

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-16 10:18:48 +10:00
Peter Hutterer
96face60c2 test: always install our own udev rule/hwdb files for tests
We can't rely on the system having these files installed, at least not in the
latest version that we'd like.
Copy them over from the source directory into the /run/ and /etc/ directories
for each test and update udev and the hwdb. This ensures the tags we set in
the hwdb file are always set, regardless of the system configuration.

Note that the /run/udev/* files need to have a different filename to the ones
we ship to avoid getting overridden by local configuration.

systemd does not have support for /run/udev/hwdb.d [1]. So our hwdb.d file
is in /etc/udev/hwdb.d instead and marked them with a REMOVEME and a comment
that if that file is left after the tests, it should be removed by the user.

[1] https://github.com/systemd/systemd/issues/127

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-12 08:51:57 +10:00
JoonCheol Park
df78ed8ad6 test: add missing libunwind cflags to test-litest-selftest
Signed-off-by: JoonCheol Park <jooncheol@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-12 08:50:42 +10:00
Peter Hutterer
36753fae8f test: fix litest_log() when libunwind is missing
Previous expansion had side-effects when litest_log was called in an if
condition without {}

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-05 11:41:59 +10:00
Peter Hutterer
bd4f129a2a test: replace a strncmp call with strneq
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-05 11:31:33 +10:00
Peter Hutterer
99aa1f5dc3 Merge branch 'master' into tablet-support 2015-06-04 12:49:18 +10:00
Peter Hutterer
8af1f4b085 touchpad: on non-resolution touchpads, use 30% as maximum clickfinger spread
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-03 14:43:58 +10:00
Peter Hutterer
df83144457 touchpad: impose maximum distance limits on clickfingers
A common use-case for clickfinger is to use the index finger for moving the
pointer, then triggering the click with a thumb. If the index finger isn't
lifted before the click this counted as two-finger click.

To avoid this, check the distance between touches on the touchpad (on
touchpads reporting resolution values anyway). If the touches are too far
apart, don't count them together (or specifically only count those close
enough together as multi-finger).

The touch area is uneven, it's wider than high. Spreading fingers horizontally
is more common and this also makes it easier to rule out thumbs which tend to
be well below the fingers.

http://bugs.freedesktop.org/show_bug.cgi?id=90526

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-03 14:43:58 +10:00
Jon A. Cruz
edb69067ef test: check getcwd() and system() return values in litest
Added code to check for errors in getcwd() and system() that
were previously ignored and silently dropped.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-02 11:19:12 +10:00
Peter Hutterer
289e4675c8 filter: enforce minimum velocity
In the current code, a timeout or direction change on the first tracker will
result in a velocity of 0. Really slow movements will thus always be zero, and
the first event after a direction is swallowed.

Enforce a minimum velocity:
In the case of a timeout, assume the current velocity is that of
distance/timeout. In the case of a direction change, the velocity is simply
that since the last tracker.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-02 09:03:07 +10:00
Peter Hutterer
aaa7622933 evdev: use the button down time for no-scroll middle button press event
When we get the release event within the timeout, we send a press + release
event for the middle button. Rather than using the release event's timestamp
for both, remember and use the button press timestamp.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-02 09:01:18 +10:00
Jon A. Cruz
c388a7e2fe test: address gcc warnings on potentially uninitialized variables.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-01 09:59:58 +10:00
Jon A. Cruz
96d4fa0364 Add xasprintf to avoid use of undefined pointer values
If asprintf fails for any reason, the contents of the pointer
are undefined. While some platforms set it to NULL, there is no
guarantee that all will.

This change adds a simple wrapper to ensure proper NULL results
on failure.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

Added LIBINPUT_PRINTF attribute and the required declaration for it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-01 08:47:14 +10:00
Peter Hutterer
742b5ccbfb test: add another wait loop for udev
Wait after deleting a device so udev can catch up with everything and the
various hooks to make sure it's happy with any newly created devices after
this.

The sleep is in the delete path to also cover the tests where we manually
create uinput devices rather than using the litest hooks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-29 12:23:05 +10:00
Peter Hutterer
887895c1c1 test: don't abort if the device filter filtered all devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-28 13:33:54 +10:00
Peter Hutterer
0dc058a0c7 touchpad: touches after the last key press can be released
The current code labels a touch as palm if it started within the typing
timeouts. To move the pointer even after the timeout expires, a user has to
lift the finger which is quite annoying and different to the old synaptics
driver behaviour (which had a simple on/off toggle on whether to let events
through or not).

Be smarter about this: if a touch starts _after_ the last key press event,
release it for pointer motion once the timeout expires. Touches started before
the last key press remain labelled as palms. This makes it possible to rest
the palm on the touchpad while typing without getting interference but also
provides a more responsive UI when moving from typing to using the touchpad
normally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
f85a46b661 touchpad: don't enable edge palm detection on Wacom touchpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
00c75a2667 test: add disable-while-typing tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
3a7264a03e touchpad: be finer-grained about when to pair touchpads/keyboard for DWT
Check a couple of easy yes/no definitives that cover most Lenovo laptops,
and avoid false positives on Wacoms.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
753cb25abb test: add an extra loop for slow udev initialization
On slower machines, e.g. VMs, udev isn't fast enough to get the properties set
up by the time we're trying to get the device going. This fails when we try to
add the device with libinput_path_add_device().

We know that all litest devices will have ID_INPUT set, so check for that
before we continue.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-27 17:38:24 +10:00
Peter Hutterer
b2a345e25d test: add tablet conversion checks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-27 11:53:42 +10:00
Peter Hutterer
21e3d416ee Merge branch 'master' into tablet-support 2015-05-26 10:39:04 +10:00
Peter Hutterer
0ca29c6ddc Add streq() helper to use instead of strcmp() == 0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-26 08:46:05 +10:00
Peter Hutterer
c4be027b90 test: fix coverity complaint about unbounded loop
buffer tainted (from fgets()) so tighten the loop conditions a bit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-25 17:30:08 +10:00
Peter Hutterer
d9f702918c test: fail if fgets() from addr2line returns NULL
Found by Coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-25 17:30:08 +10:00
Peter Hutterer
2507828f3f test: pclose the popened stream
Found by Coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-25 17:30:08 +10:00
Peter Hutterer
f2c44ac9cd test: move litest_log/vlog up outside of HAVE_LIBUNWIND
Well, the patch looks like the HAVE_LIBUNWIND bit was moved down, which is the
same thing.

litest_log and litest_vlog are called from independent paths, we have a
compiler error otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-25 16:38:12 +10:00
Peter Hutterer
602bca6977 test: fix --list for the tests
The argument worked, but the test list was empty since b2fd428f96.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-25 08:56:53 +10:00
Peter Hutterer
8bb67c2550 test: fail if the filter leaves us with zero tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 17:18:05 +10:00
Peter Hutterer
a1075070a4 test: add missing filter for function names
Was added to other places, missing from here so some tests passed the filter
despite not being selected by it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 17:18:03 +10:00
Peter Hutterer
087d25a54e Merge branch 'master' into tablet-support 2015-05-22 14:21:21 +10:00
Peter Hutterer
a6be43990c Merge branch 'litest-filter-tests'
The litest-selftest has its own main method and compiles litest.c with special
flags. Use that to ifdef out the litest.c main function, and inline the
litest_run/litest_parse_args functions so gcc doesn't complain about unused
functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 09:15:15 +10:00