Button scrolling motion events don't pass through the acceleration
filter so no need to assume the initial event will be absorbed.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Turn test_trackpoint_scroll into a generic helper function for testing
"button scrolling".
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This doesn't test for direction only, it tests for the minimum distance we
expect in the scroll event. Rename accordingly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Re-uses the touch_down interface for now, but requires the slot is always 0.
That's easier for now than adding a new interface for abs event, at least
until we have more than one device that needs it.
This device, along with a couple of similar ones have a tendency to break in
the X.Org stack without people noticing. They're special in that they have
absolute x/y axes but relative wheels. For libinput that's not as much of a
problem as it is in X but let's add them anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
In reality moving a touch from point to another takes time. In some cases
(when a timeout may trigger during the move, e.g. tap-n-drag on a touchpad),
this is important. Add a sleep_ms parameter, which will cause
litest_touch_move_to to sleep the specified amount of ms every step.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
For some tests we need to string multiple event sequences together into one
event frame. Use a push/pop frame approach that stops litest from sending any
EV_SYN/SYN_REPORT events, so we can merge two touches together by e.g.
litest_push_event_frame(d);
litest_touch_down(d, 0, 10, 10);
litest_touch_down(d, 1, 20, 50);
litest_pop_event_frame(d);
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Rather than a random msleep() with a comment, use a helper function that
describes what we're waiting for. Also makes changing the timeouts easier in
the future.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
sendevents config tests currently disabled for LITEST_TABLET until that gains
the matching bits in the dispatch.
Conflicts:
src/evdev.c
src/libinput.c
test/litest.c
test/litest.h
Make check_2fg_scroll functionality available outside of touchpad.c ,
no functional changes.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
For adding a litest device to an existing context.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
The litest features overlap with the litest device specifiers, so it's easy to
pass in LITEST_MOUSE where LITEST_POINTER should be passed in, and vice versa.
Lacking proper type checking the best we can do here is simply move the
devices into the negative range and check for that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
The most common error running the test suite is not running as root, but the
error message is hard to interpret. Make it more explicit when it failed,
printing the strerror of the errno.
Note that libevdev 1.3 is needed to get EACCES instead of EBADF
http://cgit.freedesktop.org/libevdev/commit/?id=debe9b030c8069cdf78307888ef3b65830b25122
A workaround is put in place for now until libevdev 1.3 is commonplace.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Allows to set CK_VERBOSITY to be set to "silent", "minimal", "normal", or
"verbose". Falls back to CK_NORMAL if unset.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
With a non-zero absmin for both axes and different ranges for x/y, just to
detect those errors.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
litest_wait_for_event() returns if any event is available.
litest_wait_for_event_of_type(... type, type, type, -1) returns if any of the
given event types is availble. All other events are discarded.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
When overriding events of a test device, if one would enable an event
that was already enabled by default for the overridden device, an assert
checking if the event was already enabled would fail and cause the test
to fail.
Since the merging of the default and overriding event lists is implemented
by simply concatinating them letting libevdev deal with ignoring
superfluous event enabling, remove the assert to allow the implementation
to work.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Some tests in test/path.c and test/udev.c are not dependent on
device behaviour but rather managing of device lifetime etc. Run those
tests only once with only one device, resulting more or less the same
code coverage but shorter run time.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Provides the bounding box only, with slot 0 always being the upper/left, slot
1 being the lower-right touch. This needs to use the touch_down etc. litest
interfaces, which are now widened to double (leftover from 489630f58) and a
device-specific private pointer in the litest device.
New device feature for litest: LITEST_SEMI_MT
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Set BTN_TOUCH, BTN_TOOL_DOUBLETAP automatically depending on the number of
fingers down.
This emulates real event sequences a bit better than the current approach,
though it's not a 100% correct emulation:
1) On real devices, BTN_* are usually sent last before the SYN_REPORT - here
they are sent first to slot in with the custom, device-specific event
sequence. We should only ever look at the complete sequence anyway, so this
shouldn't matter.
2) On real devices, the switch from BTN_TOOL_DOUBLETAP to TRIPLETAP and vice
versa is not always toggled within the same SYN_REPORT
3) On synaptics devices, BTN_TOUCH is released in the frame where
BTN_TOOL_DOUBLETAP is set. It is then immediately set again in the next
frame. With the current litest framework this is hard to integrate, so we
just leave BTN_TOUCH set the whole time, which is what MT devices do if
they don't have BTN_TOOL_DOUBLETAP.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Until uinput gets that capability (likely not before 3.17) all we can do is a
racy approach of setting it after creating it. That won't work well for
anything test where libinput is already listening to udev when the device is
created, but it does work for those cases where libinput is started after the
device was initialized.
And it's a better alternative than not testing anything dependent on
resolution settings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Using a 0-100% range is useful but in some cases we need events with finer
than 1% granularity.
And fix up the two-finger test that now fails. This was a bug in the test
anyway, the dx/dy supplied here was 1% of the touchpad width. Confined to
integers this meant we only ever had the touch down, then the single move by
1%. That caused two events - not enough to satisfy tp_estimate_delta, so we
always had a delta of 0/0 regardless of the size of the move.
Now with doubles this fails, so drop it to 0.1% instead, which is small enough
on all touchpads we currently have.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
And add an example xorg.conf.d .conf file for ignoring these devices under
xorg.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Instead of only allowing one owner keeping a libinput context alive,
make context reference counted, replacing libinput_destroy() with
libinput_unref() while adding another function libinput_ref().
Even though there might not be any current use cases, it doesn't mean we
should hard code this usage model in the API. The old behaviour can be
emulated by never calling libinput_ref() while replacing
libinput_destroy() with libinput_unref().
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Rather than a single global logging function, make the logging dependent on
the individual context. This way we won't stomp on each other's feet in the
(admittedly unusual) case of having multiple libinput contexts.
The userdata argument to the log handler was dropped. The caller has a ref to
the libinput context now, any userdata can be attached to that context
instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
no vfuncs are used, only input_event arrays.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Checks if the queue is empty and prints informatino about any events before
failing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Sometimes it's handy to see what libinput prints out while running a test.
This breaks test-log if run with --verbose. Checking that the default log
priority hasn't changed obviously doesn't work if we change it on demand.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
litest.c:207:1: warning: function declaration isn't a prototype
[-Wstrict-prototypes]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Avoids having to #define any values we're trying to use.
Header file is from Linux 3.15-rc8.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>