Commit graph

19 commits

Author SHA1 Message Date
Peter Hutterer
5e4dee22fd test: install per-test device quirks files
These will replace the custom udev rules we currently have in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:33:35 +10:00
Peter Hutterer
5d2501aa7d Drop HAVE_CONFIG_H ifdef
We have one. Yay. Lucky us. Go forth and celebrate.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-12-01 11:06:54 +10:00
Peter Hutterer
d82cfa1d53 test: tablet pad tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-04-18 09:12:02 +10:00
Peter Hutterer
8fe7f08e85 Merge branch 'master' into tablet-support 2015-08-26 14:24:16 +10:00
Peter Hutterer
e2b5f0abb6 test: add a comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-12 15:38:02 +10:00
Peter Hutterer
9e705bf334 Merge branch 'master' into tablet-support 2015-07-14 13:13:11 +10:00
Peter Hutterer
4a3288dc59 test: allow for a default value on LITEST_AUTO_ASSIGNS
The touchpads currently all send a default value of 30 for ABS_PRESSURE. For
some tests we want to have a custom pressure but changing all tests isn't
sensible. So hook each device up to send a default value of 30 if it isn't
overridden in the test itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:27:53 +10:00
Peter Hutterer
0d322c69d0 Merge branch 'master' into tablet-support 2015-06-22 15:20:01 +10: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
Peter Hutterer
2365f7d3d1 Merge branch 'master' into tablet-support
Added: udev-tag detection for the tablet.
libwacom assigns ID_INPUT_TABLET to all known devices but also
ID_INPUT_TOUCHPAD to all known devices with a touch interface. That's a bug
and should be fixed there but we can work around it by checking both and
making sure only one is set.

Conflicts:
	src/evdev.c
	test/misc.c
2015-02-10 15:23:38 +10:00
Peter Hutterer
4ec2947cc9 test: add per-device udev rule support
Don't rely on a magic version tag, instead let a device define a udev rule and
drop that into the udev runtime directory before the device is created.

There are a couple of caveats with this approach: first, since this changes
system-wide state it may cause issues on the device the test suite is run on.
This can be avoided if the udev rules have filter patterns that ensure only
test devices are affected.

Second, the check test suite aborts but it doesn't run the teardown() function
if a test fails. So far this wasn't a problem since uinput devices disappear
whenever we exit. The rules files will hang around though, so an unchecked
fixture was added to delete all litest-foo.rules files before and after a test
case starts. Unchecked fixtures are run regardless of the exit status of the
test but run in the same address space - i.e. no ck_assert() usage.

Also unchecked fixtures are only run once per test-case, not once per test
function. For us, that means they're only run once per device (we use the
devices as test case), i.e. if a test fails and the udev rule isn't tidied up,
the next test may be unpredictable. This shouldn't matter too much though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-02-03 10:34:26 +10:00
Peter Hutterer
a6f18c9cca Merge branch 'master' into tablet-support
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
2014-09-22 15:42:13 +10:00
Peter Hutterer
d1cc84265b test: add a semi-mt Alps test device
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>
2014-08-04 20:21:03 +10:00
Peter Hutterer
0891bc0d92 Merge branch 'master' into tablet-support 2014-07-21 09:31:37 +10:00
Peter Hutterer
489630f58b test: widen litest to use doubles for scaled variables
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>
2014-07-21 08:56:10 +10:00
Carlos Garnacho
204d1d7514 test: Add infrastructure for testing tablet events.
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>
2014-06-17 17:17:14 -04:00
Peter Hutterer
a242d68989 test: allow for description-based test devices
Most of the test devices now are static descriptions anyway, make them fully
static now, including for touch events.

Switch the synaptics device now as example, the rest comes later for easier
patch review.

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
Peter Hutterer
3a344169bb Add a device test suite
A rather large commit, copied from a similar (almost identical) suite in
libtouchpad and ported for libinput.

The goal here is to make testing for various devices easy, so the litest
("libinput test") wrappers do that. The idea is that each device has some
features, and tests are likely to exercise some features or won't work with
other features.

Each test case takes a list of required features and a list of excluded
features. The test suite will create a new test case for each device in the
suite that matches that set.

For example, the set of required LITEST_TOUCHPAD, excluded LITEST_BUTTON would
run on clickpads only, not on touchpads with buttons.

check supports suites and test cases, both named. We wrap that so that each
named set of cases we add are a test suite, with the set of devices being the
test cases. i.e.

litest_add("foo:bar", some_test_function, LITEST_ANY, LITEST_ANY);

adds a suite named "foo:bar" and test cases for both devices given, with their
shortnames as test case name, resulting in:
   "foo:bar", "trackpoint"
   "foo:bar", "clickpad"
   ...

Multiple test functions can be added to a suite. For tests without a device
requirement there is litest_add_no_device_test(...).

The environment variables CK_RUN_SUITE and CK_RUN_CASE can be used to narrow
the set of test cases. The test suite detects when run inside a debugger and
disables fork mode (the default).

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