Commit graph

8 commits

Author SHA1 Message Date
Peter Hutterer
61995348d9 test: auto-update for BTN_TOOL_* when using litest_touch_ functions
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>
2014-07-23 15:08:15 +10:00
Peter Hutterer
145cdf6c79 test: drop unused includes for libinput-util.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 09:43:52 +10:00
Peter Hutterer
fd55256768 test: fix compiler warnings for missing prototypes
litest-wacom-touch.c:31:6: warning: no previous prototype for
'litest_wacom_touch_setup' [-Wmissing-prototypes]

and similar

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:54:42 +10:00
Peter Hutterer
8e20d8105b test: fix resolution on all devices
struct input_absinfo has the resolution as the 6th field, not as the 4th.
This doesn't have any visible effect because uinput doesn't allow us to set
the resolution yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-03 11:01:05 +10:00
Peter Hutterer
c5c503c964 test: switch the remaining devices to a description-based device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-04-08 15:07:02 +10:00
Peter Hutterer
258ba1c375 test: if no teardown func is set, use the default
Reduces the amount of boilerplate code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-04-08 15:07:02 +10:00
Peter Hutterer
04d52d718f test: add litest helper functions for creating uinput devices
Both functions accept a series of event types/codes tuples, terminated by -1.
For the even type INPUT_PROP_MAX (an invalid type otherwise) the code is used
as a property to enable.

The _abs function als takes an array of absinfo, with absinfo.value
determining the axis to change. If none are given, abs axes are initialized
with default settings.

Both functions abort on failure, so the caller does not need to check the
return value.

Example code for creating a rel device:

struct libevdev_uinput *uinput;
struct input_id id = { ... };
uinput = litest_create_uinput_device("foo", &id,
                                     EV_REL, REL_X,
                                     EV_REL, REL_Y,
                                     EV_KEY, BTN_LEFT,
                                     INPUT_PROP_MAX, INPUT_PROP_BUTTONPAD,
                                     -1);
libevdev_uinput_write_event(uinput, EV_REL, REL_X, -1);
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
...
libevdev_uinput_destroy(uinput);

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-04-08 15:07:02 +10:00
Peter Hutterer
d1ba8a8fcc test: add framework for a single-touch synaptics device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-25 11:06:09 +10:00