summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Split libinput-util into a noinst helper libraryPeter Hutterer2014-12-051-3/+2
| | | | | | | | | | | | | | | | Fixes distcheck (automake 1.14.1) make[2]: Entering directory '....../libinput-0.7.0/_build/test' Makefile:926: ../src/.deps/libinput-util.Plo: No such file or directory make[2]: *** No rule to make target '../src/.deps/libinput-util.Plo'. Stop. make[2]: Leaving directory '....../libinput/libinput-0.7.0/_build/test' Makefile:412: recipe for target 'distclean-recursive' failed That was the only place we used subdir objects, so we can drop it from configure now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* test: Don't send two motion events when button scrollingJonas Ådahl2014-12-051-6/+0
| | | | | | | | | 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>
* Introduce unaccelerated motion event vectorsJonas Ådahl2014-12-052-10/+89
| | | | | | | | | | | | | | | For certain applications (such as FPS games) it is necessary to use unaccelerated motion events (the motion vector that is passed to the acceleration filter) to get a more natural feeling. Supply this information by passing both accelerated and unaccelerated motion vectors to the existing motion event. Note that the unaccelerated motion event is not equivalent to 'raw' events as read from devices. 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>
* Add libinput_device_get_context/libinput_seat_get_contextPeter Hutterer2014-12-031-0/+12
| | | | | | | Allow retrieval of the libinput context from the seat and the device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* Add a function to retrieve the udev_device handle from a libinput devicePeter Hutterer2014-12-031-0/+13
| | | | | | | | | | | | | | The libinput device abstracts a number of things but sometimes the underlying device is important. The udev device provides the necessary handle to access that underlying device and various sysfs properties that may be necessary. A function returning the device node would've done the same thing but is more prone to race conditions than the udev_device. https://bugs.freedesktop.org/show_bug.cgi?id=85573 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* evdev: Query mouse DPI from udevDerek Foreman2014-12-021-0/+42
| | | | | | | | | | Instead of using a hard coded mouse DPI value, we query it from udev. If it's not present or the property is obviously broken we fall back to default. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: move device ID test to test/device.cPeter Hutterer2014-12-012-20/+20
| | | | | | | More appropriate here, they were in misc because this file didn't exist yet when they were added. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add seat changing testsPeter Hutterer2014-11-252-2/+147
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* path: store the udev device instead of just the devnodePeter Hutterer2014-11-251-3/+5
| | | | | | | | | | | Long-term plan to use more of udev_device here is to better protect us against re-opening a different device that happens to have the same devnode. This now also prints an error message for invalid devices, the log tests are adjusted. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* Rename scroll_mode to scroll_methodPeter Hutterer2014-11-242-6/+6
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add natural scrolling tests for pointersPeter Hutterer2014-11-201-0/+56
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: Add button scroll test to pointer testsHans de Goede2014-11-111-0/+40
| | | | | | | | | Non trackpoint button scrolling is mainly intended for use with trackballs, but we can test it just as well with any relative pointer device. 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>
* test: Add litest_button_scroll helper functionHans de Goede2014-11-113-33/+45
| | | | | | | | | 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>
* test: Add trackpoint middle button scrolling disable testHans de Goede2014-11-111-0/+40
| | | | | | 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>
* test: s/test_2fg_scroll/test_trackpoint_scroll/Hans de Goede2014-11-111-7/+7
| | | | | | | | | Fix copy and paste error, causing the function to test trackpoint scrolling to be named test_2fg_scroll. 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>
* evdev: use distance triggers to start scrollingPeter Hutterer2014-11-111-0/+45
| | | | | | | | | | | | | | | | | | | | | | | The previous code used delta/event as scroll trigger which roughly translates to speed, but depends on the sampling rate of the device. For slow two-finger motion, a user may move the height of the touchpad without ever triggering scrolling. Change the _initial_ trigger to a cumulative trigger, i.e. once the user moved past the threshold distance, scrolling starts regardless of the speed. Once scrolling is engaged, the original trigger of threshold/event is required to engange the second scroll direction. Note that except for really slow movements, it's very easy to engage both scroll directions on a touchpad. This is intentional, libinput does not have enough semantic knowledge to know if horizontal scrolling is needed. So we provide some direction locking but not much, it's up to the client/toolkit/widget to decide if both scroll directions should be handled. Add a comment to clarify that in the public doc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: rename a parameter to litest_assert_scroll()Peter Hutterer2014-11-112-5/+5
| | | | | | | | 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>
* test: add VMWare Virtual USB Mouse devicePeter Hutterer2014-11-114-0/+119
| | | | | | | Yes, the name has VMware twice, not a typo. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add Xen Virtual Pointer devicePeter Hutterer2014-11-114-0/+110
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add test for absolute pointer motionPeter Hutterer2014-11-111-0/+39
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add QEMU tablet as test devicePeter Hutterer2014-11-115-1/+107
| | | | | | | | | | | | | | 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>
* test: rename LITEST_POINTER to LITEST_RELATIVEPeter Hutterer2014-11-116-10/+10
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: fix coding stylePeter Hutterer2014-11-101-3/+4
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Merge branch 'for-peter' of git://people.freedesktop.org/~jwrdegoede/libinputPeter Hutterer2014-11-075-35/+130
|\
| * touchpad: Add a test for 2fg tap-n-drag release on a 3th finger downHans de Goede2014-11-061-0/+49
| | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * touchpad: Don't send scroll events during 2 finger tap-n-dragHans de Goede2014-11-061-0/+40
| | | | | | | | | | | | | | | | | | | | | | The touchpad tap code explicitly supports 2 finger tap-n-drag, this commit adds a test-case for this, which fails due to the 2 finger scrolling code sending scroll events during a 2 finger tap-n-drag. And this commit fixes the test-case, by not sending scroll events while a tap-n-drag is active. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * touchpad: Make motion during tap-n-drag test take some timeHans de Goede2014-11-061-2/+2
| | | | | | | | | | | | | | | | | | The tap code will move individual touches to a state of TAP_TOUCH_STATE_DEAD after a timeout. In case of tap-n-drag this should not have any influence, make the litest_touch_move_to take long enough to trigger the timeout to verify that this does not has any influence. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * litest: Add a sleep_ms parameter to litest_touch_move_toHans de Goede2014-11-064-32/+38
| | | | | | | | | | | | | | | | | | 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>
* | util: introduce ratelimit helpersDavid Herrmann2014-11-071-0/+42
| | | | | | | | | | | | | | | | | | | | | | This adds "struct ratelimit" and "ratelimit_test()". It's a very simple rate-limit helper modeled after Linux' lib/ratelimit.c by Dave Young. This comes in handy to limit log-messages in possible busy loops etc.. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* | test: add the MS surface touch cover device and fake-mt testsPeter Hutterer2014-11-064-0/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | In the device description, define the interfaces for touch down/move even though we technically don't have those interfaces. Makes it easier to test. The fake-mt tests make sure the device shows up correctly and that no touch events are being sent for touch events. This device is a pointer device too, the pointer tests will test it for correct functionality of the REL_X/Y bits, no special test needed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* | Change sendevents configuration to use bitmasksPeter Hutterer2014-11-061-2/+38
|/ | | | | | | | In the future, we should allow multiple sendevent modes set simultanously. Change the API to use a bitmask instead of a single return value. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: pass an enum for the axis instead of uintPeter Hutterer2014-11-062-2/+6
| | | | | | Let's pretend that makes it type-safe. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: drop superfluous empty linePeter Hutterer2014-11-051-1/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add some left-handed testsPeter Hutterer2014-09-263-0/+457
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add litest_push/pop_event_frame() helpersPeter Hutterer2014-09-232-1/+26
| | | | | | | | | | | | | | 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>
* test: add helper functions for the two timers we care aboutPeter Hutterer2014-09-234-19/+34
| | | | | | | | | 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>
* test: add tests for natural scrollingPeter Hutterer2014-09-231-0/+49
| | | | | | | 2-finger scrolling only, we don't have anything else yet Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: Add trackpoint middlebutton scrolling testsHans de Goede2014-09-224-1/+110
| | | | | | 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>
* litest: Add litest_assert_scroll() helper functionHans de Goede2014-09-193-45/+44
| | | | | | | | | 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>
* test: Test the topbuttons of a disabled touchpad still send events through ↵Peter Hutterer2014-09-191-0/+58
| | | | | | | | the trackpoint Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* evdev: Add middle button scrolling for trackpointsHans de Goede2014-09-182-1/+5
| | | | | | | | | Most trackpoint users want to be able to scroll using the trackpoint with the middle button pressed, add support for this. 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>
* touchpad: implement conditional disablingPeter Hutterer2014-09-181-1/+18
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: test for release events on device suspendPeter Hutterer2014-09-181-0/+239
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* touchpad: hook up sendevents configurationPeter Hutterer2014-09-181-5/+5
| | | | | | | | We may be in the middle of a software button click or a tap, so make sure we go back to the device-neutral state by unwinding. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add test for device suspend/resumePeter Hutterer2014-09-182-1/+281
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* touchpad: fix tap-and-drag handling for timeoutsPeter Hutterer2014-09-181-0/+30
| | | | | | | | Doing a tap-and-drag gesture but just holding the finger instead of moving should trigger a timeout and still switchin into tap-and-drag. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: wait for events in litest_assert_button_eventsPeter Hutterer2014-09-181-1/+1
| | | | | | | Takes the onus of waiting from the caller. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: move assert_button_event to litest properPeter Hutterer2014-09-184-191/+181
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* test: add litest_add_device()Peter Hutterer2014-09-182-0/+14
| | | | | | | 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>
* test: avoid erroneous devices to be passed into the test suitesPeter Hutterer2014-09-182-10/+15
| | | | | | | | | | 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>