Commit graph

34 commits

Author SHA1 Message Date
Peter Hutterer
35b28b1af3 test: merge all tests into a single binary
Call it a libinput-test-suite-runner, in subsequent patches we'll handle doing
parallel tests ourselves instead of relying on automake features.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
fcc9a2bf18 evdev: always defuzz absolute touchscreens
If a touchscreen has a fuzz value use it for motion hysteresis similar to how
we do it for a touchpad. This stops pointer wobbles as seen in
https://bugs.freedesktop.org/show_bug.cgi?id=94918

It's up to the system to override or set the kernel's fuzz value correctly,
i.e. a udev hwdb entry is required where the kernel driver does not set it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-04-18 08:40:42 +10:00
Jonas Ådahl
240d669bba test: Handle 32 bit msec time overflows
The libinput_*_get_time() returns a 32 bit unsigned integer, but in the
tests we compared them to a 64 bit unsigned integer. This means that
when the 32 bit integer overflowed, we'd still compare to a
non-overflowed 64 bit integer, causing the tests to fail.

This commit fixes this by always casting the millisecond 64 bit unsigned
integer to a 32 unsigned integer, triggering the same overflow.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-11 07:53:25 +10:00
Jonas Ådahl
aa5f55149b Change to micro seconds for measuring time internally
In order to provide higher precision event time stamps, change the
internal time measuring from milliseconds to microseconds.
Microseconds are chosen because it is the most fine grained time stamp
we can get from evdev.

The API is extended with high precision getters whenever the given
information is available.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-28 17:42:32 +08: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
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
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
Peter Hutterer
9dbeb9d0f7 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>
2015-05-22 08:45:33 +10:00
Peter Hutterer
4889a0c3c2 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>
2015-05-21 21:41:47 +10:00
Peter Hutterer
cbfbede748 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>
2015-05-07 14:41:00 +10:00
Peter Hutterer
db03e59c52 test: add a note to the touch double-down event
libevdev filters the ABS_MT_TRACKING_ID event for a double-touch down like
this so we never see this in libinput. We see an error message from libevdev
but otherwise this test is a false negative.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-30 18:22:25 +10:00
Peter Hutterer
e0f467e70d test: upgrade to the Microsoft Surface Type Cover
Almost identical to the one we already had but this one also has ABS_X/Y to
mess things up. Update the existing one, no need to add a separate device here.

The fake MT touch test needs to be updated now though. A fake MT device may be
an absolute device too, so if we use the touch_down() handlers we may generate
abs pointer events. That's valid, we only check for no touch events here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-04-28 07:45:39 +10:00
Peter Hutterer
852e91bffd test: fix a memory leak in the touch test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-04-27 13:24:40 +10:00
Peter Hutterer
3927b63207 cosmetic: more duplicate empty line removal
This should be it now, finally...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-02 16:48:51 +10:00
Peter Hutterer
72cc601007 test: add protocol A touch screen tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-02 12:45:47 +10:00
Stephen Chandler Paul
2af608cf02 Rename functions for left handed device configurations
Some devices require more than just flipping around the buttons, such as
tablets.
When it comes to devices like tablets, because the position of the palm rest is
on the right, the entire tablet has to be flipped around in order to be usable
by lefties. As such, this requires that we reverse the coordinates of the
tablets in addition to flipping the buttons on the tablet. As such, renaming
these functions so that they aren't specific to devices where only the buttons
are flipped seems appropriate.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-15 10:17:57 +10:00
Peter Hutterer
c605276984 Merge branch 'for-peter' of git://people.freedesktop.org/~jwrdegoede/libinput 2014-11-07 11:03:12 +10:00
Peter Hutterer
d2842893a8 test: add the MS surface touch cover device and fake-mt tests
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>
2014-11-06 15:37:48 +10:00
Peter Hutterer
9b9a6a75fa test: add some left-handed tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-26 10:17:41 +10:00
Peter Hutterer
ea00ff9114 Change calibration into a configuration option
New configuration API:
	libinput_device_config_calibration_has_matrix()
	libinput_device_config_calibration_set_matrix()
	libinput_device_config_calibration_get_matrix()
	libinput_device_config_calibration_get_default_matrix()

Deprecates libinput_device_calibrate().

For coordinate transformation, we're using a precalculated matrix. Thus, to
support ..._get_matrix() we need to store the original user-specified matrix
separately, in an unmangled state.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-01 11:23:54 +10:00
Peter Hutterer
a888a7a61c test: add tests for touch calibration
Basic tests for rotation, translation and scaling events.

Note that tests need to be added separately for single-touch and touch
devices, this is a restriction of the litest framework.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-01 11:23:54 +10:00
Peter Hutterer
125e98a1f8 style fix: Remove duplicate empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-07-22 09:00:45 +10:00
Peter Hutterer
9de131f082 test: fix x/y resolution for a test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-07-16 14:29:44 +10:00
Peter Hutterer
d03488f4a3 test: prefix custom test devices with "litest"
Follow-up from 6c4778f891

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-07-04 07:57:59 +10:00
Jonas Ådahl
f3084e2c0d Use floating point numbers instead of fixed point numbers
Fixed point numbers can easily overflow, and double to fixed point
conversion is lossy. Use floating point (double) where fixed point
numbers where previously used and remove the li_fixed_t type.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-09 20:46:53 +02:00
Peter Hutterer
54431242ce test: fix a couple of memleaks in the tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-23 12:43:23 +10:00
Jonas Ådahl
2b63c7c872 test: Check that libinput doesn't send double touch down/up events
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-04-23 00:07:40 +02:00
Jonas Ådahl
f8e8a265fe test: Test handling of many touch points
libinput currently handles 16 per device touch points. Test that we
behave as expected when a device has an even higher number of active
touch points.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-23 00:07:37 +02:00
Peter Hutterer
4802a792b3 test: fix memleak in touch test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-10 11:11:56 +10:00
Jonas Ådahl
3bee64a845 test: Use generic test device API in touch_abs_transform test
Instead of having a test device which only purpose is to test absolute
coordinate transformation, use the litest_create_device_with_overrides()
API to create a specially crafted wacom touch device with high
resolution.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-08 23:07:49 +02:00
Peter Hutterer
2001443100 test: plug a couple of memory leaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-27 08:46:47 +10:00
Jonas Ådahl
6f0ca1a386 Split up the touch event into the different touch types
Instead of having one touch events representing different types of touch
events by providing a touch type, have one separate event type per touch
type. This means the LIBINPUT_EVENT_TYPE_TOUCH is replaced with
LIBINPUT_EVENT_TYPE_TOUCH_DOWN, LIBINPUT_EVENT_TYPE_TOUCH_MOTION,
LIBINPUT_EVENT_TYPE_TOUCH_UP and LIBINPUT_EVENT_TYPE_TOUCH_CANCEL.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-02-26 19:32:33 +01:00
Jonas Ådahl
ad24bc07f8 test: Add scale li_fixed overflow test
Add a test case and test device that checks if the scale transform can
handle high resolution devices and output monitor resolutions.

The test case is created in a way that it will fail if the coordinate
transform expression will overflow if only 32 bit integer data
containers are used.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-20 11:30:08 +10:00
Peter Hutterer
05cc4a8ca8 test: add a simple touch test
Currently testing for touch frame events only

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 11:32:01 +10:00