Peter Hutterer [Wed, 27 May 2015 23:33:07 +0000 (09:33 +1000)]
README: add two diagrams to outline the stack
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:12:33 +0000 (08:12 +1000)]
COPYING: note that having linux/input.h in the tree does not make libinput GPL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Sat, 30 May 2015 01:40:25 +0000 (18:40 -0700)]
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>
Jon A. Cruz [Fri, 29 May 2015 02:01:01 +0000 (19:01 -0700)]
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>
Jon A. Cruz [Sun, 31 May 2015 22:09:26 +0000 (08:09 +1000)]
Add missing config.h includes
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 29 May 2015 01:11:56 +0000 (11:11 +1000)]
evdev: use the udev ID_INPUT_POINTINGSTICK property
Added in systemd 220, but note that for udev backwards compatibility, the
ID_INPUT_POINTINGSTICK tag is set in addition to the ID_INPUT_MOUSE tag.
And use that property to tag a device as trackpoint too, this allows temporary
workarounds for kernel bugs where the input prop isn't set yet.
https://bugzilla.redhat.com/show_bug.cgi?id=1225563
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 28 May 2015 21:29:07 +0000 (07:29 +1000)]
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>
Peter Hutterer [Thu, 28 May 2015 03:41:58 +0000 (13:41 +1000)]
touchpad: check touchpad for basic features we expect
If a relative device is tagged by udev as ID_INPUT_TOUCHPAD we need to
catch this before we try to dereference device->abs.absinfo_x.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 29 May 2015 02:13:02 +0000 (12:13 +1000)]
tools: print symbolic key names too from event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 03:33:54 +0000 (13:33 +1000)]
test: don't abort if the device filter filtered all devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:04:42 +0000 (08:04 +1000)]
README: spice up the readme a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 01:54:34 +0000 (11:54 +1000)]
doc: improve the T440 documentation a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 00:46:02 +0000 (10:46 +1000)]
doc: add illustrations for clickfinger and software button behavior
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:53:00 +0000 (08:53 +1000)]
doc: add a blurb about scroll sources to the scrolling docs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:23:59 +0000 (08:23 +1000)]
Update Red Hat's copyright
Updated to 2015 where appropriate, added where missing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 08:29:26 +0000 (18:29 +1000)]
touchpad: add missing break statement
No effect since it was the last case, but it's more correct.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 May 2015 06:32:42 +0000 (16:32 +1000)]
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>
Peter Hutterer [Mon, 25 May 2015 06:02:56 +0000 (16:02 +1000)]
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>
Peter Hutterer [Mon, 25 May 2015 01:36:34 +0000 (11:36 +1000)]
touchpad: reset the touch state when edge scrolling is stopped
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>
Peter Hutterer [Fri, 22 May 2015 05:14:04 +0000 (15:14 +1000)]
touchpad: add palm state debugging
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>
Peter Hutterer [Thu, 21 May 2015 03:30:24 +0000 (13:30 +1000)]
touchpad: split disable-while-typing handling into a helper function
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>
Peter Hutterer [Thu, 21 May 2015 06:58:27 +0000 (16:58 +1000)]
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>
Peter Hutterer [Fri, 22 May 2015 06:07:10 +0000 (16:07 +1000)]
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>
Peter Hutterer [Fri, 22 May 2015 05:51:18 +0000 (15:51 +1000)]
touchpad: only check keyboards for disable-while-typing
The keyboard test is a simple one, if we have the first row of alphabetic
keys, we assume it's a full keyboard.
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>
Peter Hutterer [Fri, 22 May 2015 05:16:31 +0000 (15:16 +1000)]
touchpad: add helper function to get from tp to the libinput context
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>
Peter Hutterer [Sun, 24 May 2015 22:48:25 +0000 (08:48 +1000)]
touchpad: extend the key blacklist for disable-while-typing
Alt-tab should not trigger the disable-while-typing timeout, likewise with the
F-keys, multimedia keys, the windows and menu key, etc.
https://bugs.freedesktop.org/show_bug.cgi?id=90613
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>
Peter Hutterer [Mon, 25 May 2015 00:07:51 +0000 (10:07 +1000)]
touchpad: move disable-while-typing into its own struct
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>
Peter Hutterer [Tue, 26 May 2015 00:44:16 +0000 (20:44 -0400)]
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>
Peter Hutterer [Mon, 25 May 2015 22:49:04 +0000 (08:49 +1000)]
evdev: rename evdev_compare_syspath for clarity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 22:46:05 +0000 (08:46 +1000)]
Add streq() helper to use instead of strcmp() == 0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 07:27:14 +0000 (17:27 +1000)]
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>
Peter Hutterer [Mon, 25 May 2015 07:04:56 +0000 (17:04 +1000)]
test: fail if fgets() from addr2line returns NULL
Found by Coverity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 06:50:54 +0000 (16:50 +1000)]
test: pclose the popened stream
Found by Coverity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 06:38:12 +0000 (16:38 +1000)]
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>
Peter Hutterer [Sun, 24 May 2015 23:06:32 +0000 (09:06 +1000)]
Add a few more exclusions to .gitignore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 24 May 2015 23:02:25 +0000 (09:02 +1000)]
Add .vimdir for libinput-specific settings
To avoid introducing broken indentations when I'm working in different
directories than the standard one add the vimdir with the local settings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 24 May 2015 22:56:53 +0000 (08:56 +1000)]
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>
Peter Hutterer [Fri, 22 May 2015 04:56:09 +0000 (14:56 +1000)]
test: fail if the filter leaves us with zero tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 22 May 2015 04:55:24 +0000 (14:55 +1000)]
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>
Peter Hutterer [Thu, 21 May 2015 23:06:07 +0000 (09:06 +1000)]
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>
Peter Hutterer [Wed, 20 May 2015 01:04:13 +0000 (11:04 +1000)]
doc: drop leftovers of Check's selective test running
CK_RUN_CASE and CK_RUN_SUITE still work because we're still using check
underneath, but it's better to use the arguments.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 01:00:37 +0000 (11:00 +1000)]
test: add --filter-group argument to match test groups (suites)
Same as CK_RUN_SUITE, but supports fnmatch-like globs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 00:49:13 +0000 (10:49 +1000)]
test: add --filter-device argument
Similar to the CK_RUN_CASE environment variable, but it does support
fnmatch()-style wildcards, e.g.
./test/test-touchpad --filter-device="synaptics*"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 00:12:39 +0000 (10:12 +1000)]
test: add filtering to litest framework
Complementary to CK_RUN_SUITE and CK_RUN_CASE, this filters on actual test
function names with a simple fnmatch.
./test/test-touchpad --filter-test="*1fg_tap*"
Most of this patch is renaming litest_add_* to _litest_add_* so we can use the
macros to get at the function names.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 23:46:54 +0000 (09:46 +1000)]
test: move argument parsing into a separate function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 23:36:01 +0000 (09:36 +1000)]
test: move main() into litest
This allows us to filter things based on argv before setting up tests, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 8 May 2015 03:30:13 +0000 (13:30 +1000)]
touchpad: sync the initial touch state
Unlikely, but there's the odd chance of the first touch coming in with the
same X or Y coordinate the kernel already has internally. This would
generate a bogus delta on the second event when the touch coordinate jumps
from 0/y or x/0 to the real coordinates.
For touchpads with distance support this is a real issue since the default
value for a touch distance is > 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 8 May 2015 04:41:42 +0000 (14:41 +1000)]
evdev: sync the initial state for absolute pointer devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 8 May 2015 03:06:25 +0000 (13:06 +1000)]
evdev: sync the initial x/y position for touchscreens
Unlikely, but there's the odd chance of the first touch coming in with the
same X or Y coordinate the kernel already has internally. This would generate
a x/0 or 0/y event in libinput.
Sync the slot state on init, at least for Protocol B devices. For Protocol A
devices and mtdev, don't bother.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 05:57:11 +0000 (15:57 +1000)]
evdev: add an interface hook to suspend a device
The touchpad carries enough state around that calling release_all_keys() isn't
enough to properly suspend it. e.g. a button down after tapping won't be
released by trying to release the physical button for it.
We need to clear the state properly, but that's interface-specific so add a
new hook for it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 05:37:18 +0000 (15:37 +1000)]
evdev: move release_pressed_keys() up
Just a move to make the next diff easier
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 05:52:17 +0000 (15:52 +1000)]
touchpad: rename all interface functions for clarity
Add "interface" to the name to make things a bit clearer.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 04:44:16 +0000 (14:44 +1000)]
evdev: log a bug if releasing a key fails, but don't loop forever
If a physical button is down but releasing said button doesn't actually
release it, we loop endlessly. Detect that and log a bug instead.
Reproducible: trigger a tap-n-drag on a touchpad device, then remove it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 21 May 2015 06:40:24 +0000 (16:40 +1000)]
test: add missing linebreak in debug error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jan Alexander Steffens (heftig) [Mon, 18 May 2015 13:13:23 +0000 (15:13 +0200)]
Rename MODEL_SYSTEM76_CLEVO to MODEL_CLEVO_W740SU
The System76 Galago Ultra Pro is a rebranded Clevo W740SU with changed
firmware strings. To my knowledge, the Clevo W740SU and all its rebrands
possess smooth touchpads.
In the original bug report[1], a Galago Ultra Pro was returned to the
original DMI strings by flashing another firmware. This resulted in the
model identified as MODEL_SYSTEM76_CLEVO.
Since the actual manufacturer of the W740SU is Clevo and the CLEVO hwdb
entry already properly identifies other W740SU rebrands like the Schenker
S413, the model should be renamed to match.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=90170#c3
https://bugs.freedesktop.org/show_bug.cgi?id=90353
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 May 2015 01:05:45 +0000 (11:05 +1000)]
Merge branch 'litest-backtrace'
Peter Hutterer [Tue, 19 May 2015 23:21:26 +0000 (09:21 +1000)]
test: move opening { to next line
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 00:57:11 +0000 (10:57 +1000)]
doc: clarify a comment what a "no device" test case means
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 06:22:14 +0000 (16:22 +1000)]
Allow disabling of middle button emulation where it doesn't exist
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 06:01:55 +0000 (16:01 +1000)]
Allow disabling tapping on a device without tapping
The doc says this "always succeeds", not "segfaults".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 00:57:27 +0000 (10:57 +1000)]
test: add a note to one of the device tests
If we get two different sysnames for the device, this test doesn't test
anything much, so it's better to fail here. But add a comment so that when it
fails it's quite obvious why.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 00:33:24 +0000 (10:33 +1000)]
test: parse the LITEST_VERBOSE environment variable
--verbose only works when running a specific test, sometimes we need make
check to be more verbose. Set this by default for make check, the log becomes
a lot more expressive that way
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 00:24:36 +0000 (10:24 +1000)]
path: be more lenient waiting for udev to settle things
Running tests in parallel can exceed the current 100ms max timeout for udev to
settle things. Since this pretty much only triggers in test cases anyway,
let's be more lenient here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 18 May 2015 05:59:09 +0000 (15:59 +1000)]
test: drop unneeded includes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 01:40:39 +0000 (11:40 +1000)]
test: convert all helper functions to use the litest macros
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 7 May 2015 23:31:44 +0000 (09:31 +1000)]
test: extract file:line from backtrace with addr2line
libunwind gives us a file and an address and usually a function name. Beyond
that, it's mostly guessing.
Fork off addr2line to resolve the addresses that libunwind gives us, if we
succeed we get a backtrace like this:
Backtrace:
0: litest_fail_comparison_int() (./test/litest.c:268)
1: disable_button_scrolling() (./test/pointer.c:115)
2: middlebutton_doubleclick() (./test/pointer.c:991)
3: /lib64/libcheck.so.0 (srunner_run+0x7f5) [0x7f6c12d8c025]
4: litest_run() (./test/litest.c:689)
5: main() (./test/pointer.c:1280)
6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f6c11a73790]
7: ./test/test-pointer (_start+0x29) [0x403d99]
8: ? (?+0x29) [0x29]
Note: I intentionally swapped function/file name in the output to make it
easier to spot which one is fully resolved and which one is the basic
libunwind output.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 7 May 2015 22:16:39 +0000 (08:16 +1000)]
test: add pointer comparison macros
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 3 May 2015 23:13:22 +0000 (09:13 +1000)]
test: add a backtrace facility to litest
The check unit test framework isn't particularly suited to having ck_assert*
calls in helper functions. A failed assertion in a helper function or the
litest framework merely gives us a the failed line in litest.c.
which doesn't tell us which test actually failed.
Add a backtracing facility with litest_backtrace(). And since this requires
wrapping all ck_assert macros with litest_assert() this patch ended up
replacing/duplicating a bunch of ck_assert_* bits. So rather than
ck_assert_int_eq() we now use litest_assert_int_eq(), etc. in the litest
framework itself.
The int comparison macros are more type-safe than ck_assert()'s macros which
just cast all the ints to intmax_t.
Backtrace is spewed to stderr, which is good enough for debugging. Example
backtrace:
FAILED COMPARISON: status != expected
Resolved to: 0 != 0
in disable_button_scrolling() (pointer.c:115)
Backtrace:
0: ./test/test-pointer (litest_fail_comparison_int+0xab) [0x40973b]
1: ./test/test-pointer (disable_button_scrolling+0x174) [0x40421b]
2: ./test/test-pointer (middlebutton_middleclick+0x40) [0x40829c]
3: /lib64/libcheck.so.0 (srunner_run+0x7f5) [0x7f0e8a277025]
4: ./test/test-pointer (litest_run+0x107) [0x40a42b]
5: ./test/test-pointer (main+0x2fa) [0x4090e7]
6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f0e88f5e790]
7: ./test/test-pointer (_start+0x29) [0x403ce9]
8: ? (?+0x29) [0x29]
litest_backtrace() itself is copied from xserver/os/backtrace.c which git
blame attributes to Marcin.
CC: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 May 2015 01:52:32 +0000 (11:52 +1000)]
test: cast to int before integer comparison
No effect with the current macros since they'll cast to int for us, but this
will change with the litest_assert macros.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 01:29:49 +0000 (11:29 +1000)]
test: don't use enum values in ck_assert macros directly
Unfortunately, typeof(enum something) != typeof(ENUM_VALUE) and produces a
-Wsign-compare warning
Preemptively fix this, it'll show up in the upcoming litest_asssert macros
otherwise.
This fix only applies to helper functions, tests themselves wont (yet) be
switched to the new macros and don't need fixing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 01:27:25 +0000 (11:27 +1000)]
test: type-safe two ck_assert invocations
unsigned vs signed in both cases, but the ck_assert macros hide that
(everything is cast to intmax_t). The upcoming litest_assert wrappers expose
these warnings, so fix them ahead of time.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 18 May 2015 04:54:50 +0000 (14:54 +1000)]
doc: add some documentation for disable-while-typing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 20 Apr 2015 06:20:00 +0000 (16:20 +1000)]
touchpad: use a two-stage timeout for disable-while-typing
Hitting a single key triggers a short timeout, just enough to cover the time
to the next key event. Hitting more than one key triggers the longer timeout.
This should improve responsiveness after single key events when the touchpad is
still the main interaction mode and a key needs to be pressed to advance in
the UI. When typing the hands require physical movement to get back to the
touchpad anyway so a longer timeout is acceptable and more reliable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 20 Apr 2015 05:51:20 +0000 (15:51 +1000)]
touchpad: add timeout-based disable-while-typing
On some touchpads, typing triggers touches in areas of the touchpad that
cannot easily be distinguished from other fingers. Pressure information is
useless too, so we have to go back to a timeout-based handling of touch data.
If we see non-modifier key events, disable the touchpad for a timeout and set
any touches starting during that timeout as palm.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 20 Apr 2015 06:09:31 +0000 (16:09 +1000)]
touchpad: switch from is_palm to an enum
Preparation to add different palm detection types. Not all of them need to be
un-done when leaving the edge area so a boolean is not enough.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 18 May 2015 04:07:45 +0000 (14:07 +1000)]
Merge branch 'tap-to-end-drag'
Changed the test merged in to use the new ranged litests functionality
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Velimir Lisec [Wed, 6 May 2015 06:42:37 +0000 (08:42 +0200)]
test: add test cases for ending drag with a tap
Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Velimir Lisec [Wed, 29 Apr 2015 22:13:51 +0000 (00:13 +0200)]
touchpad: end tap-and-drag with an extra tap
Currently for the tap-and-drag gesture to end user has to wait for a
timeout to expire. Make it possible to end the drag gesture by just tapping.
The allowed finger sequences to start and end a drag are thus:
tap, down, .... move ...., up <wait for timeout>
tap, down, .... move ...., up, tap
https://bugs.freedesktop.org/show_bug.cgi?id=90255
Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
State diagram changes and a doc change squashed in.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 May 2015 23:20:44 +0000 (09:20 +1000)]
timer: fix coverity warning about unused return value
"read(int, void *, size_t)" returns the number of bytes read, but it
is ignored.
We don't really care about the number of bytes, but let's complain if we get
anything but EAGAIN.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 5 May 2015 22:33:06 +0000 (08:33 +1000)]
test: switch the touchpad multitap tests over to ranged tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 5 May 2015 22:26:47 +0000 (08:26 +1000)]
test: switch the abs ranged tests over to real ranged tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 5 May 2015 22:09:50 +0000 (08:09 +1000)]
test: add litest_add_ranged* functionality
litest_add_ranged* takes a range parameter that serves as the lower/upper
boundary for a loop. This enables tests to be run multiple times, avoiding the
timeouts we triggered by having the loops inside (e.g. see
2bf8d035c and
6dd02468).
This just wraps the underlying check framework, the ranged variable is
available as "_i" in the test.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 23 Apr 2015 07:33:17 +0000 (17:33 +1000)]
tools: add middle button emulation to listed capabilities
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 03:57:31 +0000 (13:57 +1000)]
test: use litest_is_button_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 5 May 2015 05:43:08 +0000 (15:43 +1000)]
test: add litest_is_keyboard_event() helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 4 May 2015 03:51:39 +0000 (13:51 +1000)]
test: add litest_is_touch_event() helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 4 May 2015 03:17:27 +0000 (13:17 +1000)]
test: add litest_is_motion_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 4 May 2015 03:11:21 +0000 (13:11 +1000)]
test: add litest_is_axis_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 4 May 2015 10:55:37 +0000 (20:55 +1000)]
test: re-order the tests to have the likely ones to fail first
Run the touchpad tests first, it's the most likely to fail. It also takes the
longest, so it's annoying to have it fail when you spent a minute watching the
other tests succeed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Sun, 3 May 2015 23:30:51 +0000 (09:30 +1000)]
test: litest_is_button_event should take an unsigned int
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Benjamin Tissoires [Wed, 6 May 2015 23:41:25 +0000 (19:41 -0400)]
touchpad: add support for per-finger hovering information
When the device supports true hovering, it reports this
information through ABS_MT_DISTANCE.
When this axis is available, we should rely on it to
(un)hover the touches as BTN_TOUCH is most of the time
unreliable (generated by the mouse emulation in the kernel).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 6 May 2015 03:14:23 +0000 (13:14 +1000)]
filter: add Simon's copyright
This code was largely lifted from the X server in
bb25b2ad297891430606c367bfabc but didn't take the copyright messages that
applied to that code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jonas Ã…dahl <jadahl@gmail.com>
Acked-by: Simon Thum <simon.thum@gmx.de>
Benjamin Tissoires [Thu, 30 Apr 2015 20:30:24 +0000 (16:30 -0400)]
test: rename hover tests into semi_mt_hover
The current hover tests are uniquely designed for some Synaptics
touchpad. libinput can handle hovering through ABS_MT_DISTANCE,
so we need to reserve the "hover" name for real hovering devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Benjamin Tissoires [Thu, 30 Apr 2015 20:30:23 +0000 (16:30 -0400)]
test: bcm5974: down should be marked as static
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 6 May 2015 02:16:15 +0000 (12:16 +1000)]
doc: add a page about the test suite
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 6 May 2015 01:55:48 +0000 (11:55 +1000)]
test: return the right value from open_restricted
fd or negative errno on failure.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 6 May 2015 00:49:17 +0000 (10:49 +1000)]
test: move a comment to where it belongs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 May 2015 07:20:35 +0000 (17:20 +1000)]
configure.ac: libinput 0.15.0 - this time for real
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 May 2015 06:01:59 +0000 (16:01 +1000)]
configure.ac: libinput 0.15.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 May 2015 06:46:18 +0000 (16:46 +1000)]
test: split test for invalid ranges into hi/lo
This test can randomly trigger a timeout, depending on how busy the machine
is.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>