Commit graph

357 commits

Author SHA1 Message Date
Jonas Ådahl
1f1304041c Replace output screen size callback with transform helpers
Instead of automatically transforming absolute coordinates of touch and
pointer events to screen coordinates, the user now uses the corresponding
transform helper function. This means the coordinates returned by
libinput_event_pointer_get_absolute_x(),
libinput_event_pointer_get_absolute_y(), libinput_touch_get_x() and
libinput_touch_get_y() has changed from being in output screen coordinate
space to being in device specific coordinate space.

For example, where one before would call libinput_event_touch_get_x(event),
one now calls libinput_event_touch_get_x_transformed(event, output_width).

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-02-03 23:39:58 +01:00
Peter Hutterer
6f1e422a5e test: add a wacom touch devices (absolute touchscreen)
This means we do have to provide the get_current_screen_dimensions() call in
litest now, just hardcode it to 1024x768.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 11:23:00 +10:00
Peter Hutterer
404a0ea14e test: Add a basic mouse test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 11:23:00 +10:00
Peter Hutterer
4ec24b2037 test: Add a common helper function to drain all current events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 11:23:00 +10:00
Jonas Ådahl
ec717caad1 test: Remove short option and fail on invalid options
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-01-15 23:24:21 +01:00
Jonas Ådahl
a9a6a6099d test: Fix optstring in getopt_long call
Was missing the "l".

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-01-15 21:11:51 +01: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