Commit 35b28b1a authored by Peter Hutterer's avatar Peter Hutterer

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's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent bc76bd6f
......@@ -4,8 +4,8 @@
The libinput test suite is based on
[Check](http://check.sourceforge.net/doc/check_html/) and runs automatically
during `make check`. Check itself is wrapped into a libinput-specific test
suite called *litest*. Tests are found in `$srcdir/test/`, the test binaries are
prefixed with `test-` and can be run individually.
suite called *litest*. Tests are found in `$srcdir/test/`, the main test
suite is `libinput-test-suite-runner`.
@section test-config X.Org config to avoid interference
......@@ -30,7 +30,7 @@ litest's tests are grouped by test groups and devices. A test group is e.g.
Each test function is (usually) run with one or more specific devices.
The `--list` commandline argument shows the list of suites and tests.
@code
$ ./test/test-device --list
$ ./test/libinput-test-suite-runner --list
device:wheel:
wheel only
blackwidow
......@@ -56,7 +56,7 @@ The `--filter-test` argument enables selective running of tests through
basic shell-style function name matching. For example:
@code
$ ./test/test-touchpad --filter-test="*1fg_tap*"
$ ./test/libinput-test-suite-runner --filter-test="*1fg_tap*"
@endcode
The `--filter-device` argument enables selective running of tests through
......@@ -64,7 +64,7 @@ basic shell-style device name matching. The device names matched are the
litest-specific shortnames, see the output of `--list`. For example:
@code
$ ./test/test-touchpad --filter-device="synaptics*"
$ ./test/libinput-test-suite-runner --filter-device="synaptics*"
@endcode
The `--filter-group` argument enables selective running of test groups
......@@ -72,7 +72,7 @@ through basic shell-style test group matching. The test groups matched are
litest-specific test groups, see the output of `--list`. For example:
@code
$ ./test/test-touchpad --filter-group="touchpad:*hover*"
$ ./test/libinput-test-suite-runner --filter-group="touchpad:*hover*"
@endcode
The `--filter-device` and `--filter-group` arguments can be combined with
......@@ -85,7 +85,7 @@ output, see libinput_log_set_priority() for details. The `LITEST_VERBOSE`
environment variable, if set, also enables verbose mode.
@code
$ ./test/test-device --verbose
$ ./test/libinput-test-suite-runner --verbose
$ LITEST_VERBOSE=1 make check
@endcode
......
......@@ -77,24 +77,8 @@ liblitest_la_LIBADD += $(LIBUNWIND_LIBS) -ldl
liblitest_la_CFLAGS += $(LIBUNWIND_CFLAGS)
endif
run_tests = \
test-touchpad \
test-touchpad-tap \
test-touchpad-buttons \
test-pad \
test-tablet \
test-device \
test-gestures \
test-pointer \
test-touch \
test-trackball \
test-trackpoint \
test-udev \
test-path \
test-log \
test-misc \
test-keyboard \
test-litest-selftest
run_tests = libinput-test-suite-runner \
test-litest-selftest
build_tests = \
test-build-cxx \
......@@ -108,70 +92,26 @@ TESTS = $(run_tests) symbols-leak-test
.NOTPARALLEL:
test_udev_SOURCES = udev.c
test_udev_LDADD = $(TEST_LIBS)
test_udev_LDFLAGS = -no-install
test_path_SOURCES = path.c
test_path_LDADD = $(TEST_LIBS)
test_path_LDFLAGS = -no-install
test_pointer_SOURCES = pointer.c
test_pointer_LDADD = $(TEST_LIBS)
test_pointer_LDFLAGS = -no-install
test_touch_SOURCES = touch.c
test_touch_LDADD = $(TEST_LIBS)
test_touch_LDFLAGS = -no-install
test_log_SOURCES = log.c
test_log_LDADD = $(TEST_LIBS)
test_log_LDFLAGS = -no-install
test_tablet_SOURCES = tablet.c
test_tablet_LDADD = $(TEST_LIBS)
test_tablet_LDFLAGS = -static
test_pad_SOURCES = pad.c
test_pad_LDADD = $(TEST_LIBS)
test_pad_LDFLAGS = -static
test_touchpad_SOURCES = touchpad.c
test_touchpad_LDADD = $(TEST_LIBS)
test_touchpad_LDFLAGS = -no-install
test_touchpad_tap_SOURCES = touchpad-tap.c
test_touchpad_tap_LDADD = $(TEST_LIBS)
test_touchpad_tap_LDFLAGS = -no-install
test_touchpad_buttons_SOURCES = touchpad-buttons.c
test_touchpad_buttons_LDADD = $(TEST_LIBS)
test_touchpad_buttons_LDFLAGS = -no-install
test_trackpoint_SOURCES = trackpoint.c
test_trackpoint_LDADD = $(TEST_LIBS)
test_trackpoint_LDFLAGS = -no-install
test_trackball_SOURCES = trackball.c
test_trackball_LDADD = $(TEST_LIBS)
test_trackball_LDFLAGS = -no-install
test_misc_SOURCES = misc.c
test_misc_CFLAGS= $(AM_CFLAGS) -DLIBINPUT_LT_VERSION="\"$(LIBINPUT_LT_VERSION)\""
test_misc_LDADD = $(TEST_LIBS)
test_misc_LDFLAGS = -no-install
test_keyboard_SOURCES = keyboard.c
test_keyboard_LDADD = $(TEST_LIBS)
test_keyboard_LDFLAGS = -no-install
test_device_SOURCES = device.c
test_device_LDADD = $(TEST_LIBS)
test_device_LDFLAGS = -no-install
test_gestures_SOURCES = gestures.c
test_gestures_LDADD = $(TEST_LIBS)
test_gestures_LDFLAGS = -no-install
libinput_test_suite_runner_SOURCES = udev.c \
path.c \
pointer.c \
touch.c \
log.c \
tablet.c \
pad.c \
touchpad.c \
touchpad-tap.c \
touchpad-buttons.c \
trackpoint.c \
trackball.c \
misc.c \
keyboard.c \
device.c \
gestures.c
libinput_test_suite_runner_CFLAGS = $(AM_CFLAGS) -DLIBINPUT_LT_VERSION="\"$(LIBINPUT_LT_VERSION)\""
libinput_test_suite_runner_LDADD = $(TEST_LIBS)
libinput_test_suite_runner_LDFLAGS = -no-install
test_litest_selftest_SOURCES = litest-selftest.c litest.c litest-int.h litest.h
test_litest_selftest_CFLAGS = -DLITEST_DISABLE_BACKTRACE_LOGGING -DLITEST_NO_MAIN $(liblitest_la_CFLAGS)
......
......@@ -1347,7 +1347,7 @@ START_TEST(device_quirks_apple_magicmouse)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_device(void)
{
struct range abs_range = { 0, ABS_MISC };
struct range abs_mt_range = { ABS_MT_SLOT + 1, ABS_CNT };
......
......@@ -1215,7 +1215,7 @@ START_TEST(gestures_3fg_buttonarea_scroll_btntool)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_gestures(void)
{
/* N, NE, ... */
struct range cardinals = { 0, 8 };
......
......@@ -379,7 +379,7 @@ START_TEST(keyboard_no_buttons)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_keyboard(void)
{
litest_add_no_device("keyboard:seat key count", keyboard_seat_key_count);
litest_add_no_device("keyboard:key counting", keyboard_ignore_no_pressed_release);
......
......@@ -3143,7 +3143,22 @@ main(int argc, char **argv)
if (mode == LITEST_MODE_ERROR)
return EXIT_FAILURE;
litest_setup_tests();
litest_setup_tests_udev();
litest_setup_tests_path();
litest_setup_tests_pointer();
litest_setup_tests_touch();
litest_setup_tests_log();
litest_setup_tests_tablet();
litest_setup_tests_pad();
litest_setup_tests_touchpad();
litest_setup_tests_touchpad_tap();
litest_setup_tests_touchpad_buttons();
litest_setup_tests_trackpoint();
litest_setup_tests_trackball();
litest_setup_tests_misc();
litest_setup_tests_keyboard();
litest_setup_tests_device();
litest_setup_tests_gestures();
if (mode == LITEST_MODE_LIST) {
litest_list_tests(&all_tests);
......
......@@ -35,6 +35,23 @@
#include <libinput.h>
#include <math.h>
extern void litest_setup_tests_udev(void);
extern void litest_setup_tests_path(void);
extern void litest_setup_tests_pointer(void);
extern void litest_setup_tests_touch(void);
extern void litest_setup_tests_log(void);
extern void litest_setup_tests_tablet(void);
extern void litest_setup_tests_pad(void);
extern void litest_setup_tests_touchpad(void);
extern void litest_setup_tests_touchpad_tap(void);
extern void litest_setup_tests_touchpad_buttons(void);
extern void litest_setup_tests_trackpoint(void);
extern void litest_setup_tests_trackball(void);
extern void litest_setup_tests_misc(void);
extern void litest_setup_tests_keyboard(void);
extern void litest_setup_tests_device(void);
extern void litest_setup_tests_gestures(void);
void
litest_fail_condition(const char *file,
int line,
......@@ -334,9 +351,6 @@ _litest_add_ranged_no_device(const char *name,
void *func,
const struct range *range);
extern void
litest_setup_tests(void);
struct litest_device *
litest_create_device(enum litest_device_type which);
......
......@@ -141,7 +141,7 @@ START_TEST(log_priority)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_log(void)
{
litest_add_no_device("log:defaults", log_default_priority);
litest_add_no_device("log:logging", log_handler_invoked);
......
......@@ -935,7 +935,7 @@ START_TEST(library_version)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_misc(void)
{
litest_add_no_device("events:conversion", event_conversion_device_notify);
litest_add_for_device("events:conversion", event_conversion_pointer, LITEST_MOUSE);
......
......@@ -632,7 +632,7 @@ START_TEST(pad_mode_group_has_no_toggle)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_pad(void)
{
litest_add("pad:cap", pad_cap, LITEST_TABLET_PAD, LITEST_ANY);
litest_add("pad:cap", pad_no_cap, LITEST_ANY, LITEST_TABLET_PAD);
......
......@@ -938,7 +938,7 @@ START_TEST(path_seat_recycle)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_path(void)
{
litest_add_no_device("path:create", path_create_NULL);
litest_add_no_device("path:create", path_create_invalid);
......
......@@ -1723,7 +1723,7 @@ START_TEST(pointer_time_usec)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_pointer(void)
{
struct range axis_range = {ABS_X, ABS_Y + 1};
struct range compass = {0, 7}; /* cardinal directions */
......
......@@ -3676,7 +3676,7 @@ START_TEST(relative_calibration)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_tablet(void)
{
litest_add("tablet:tool", tool_ref, LITEST_TABLET | LITEST_TOOL_SERIAL, LITEST_ANY);
litest_add_no_device("tablet:tool", tool_capabilities);
......
......@@ -720,7 +720,7 @@ START_TEST(touch_fuzz)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_touch(void)
{
struct range axes = { ABS_X, ABS_Y + 1};
......
......@@ -1805,7 +1805,7 @@ START_TEST(clickpad_middleemulation_click_disable_while_down)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_touchpad_buttons(void)
{
litest_add("touchpad:clickfinger", touchpad_1fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:clickfinger", touchpad_1fg_clickfinger_no_touch, LITEST_CLICKPAD, LITEST_ANY);
......
......@@ -1959,7 +1959,7 @@ START_TEST(touchpad_drag_lock_default_unavailable)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_touchpad_tap(void)
{
struct range multitap_range = {3, 8};
......
......@@ -4136,7 +4136,7 @@ START_TEST(touchpad_jump_finger_motion)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_touchpad(void)
{
struct range axis_range = {ABS_X, ABS_Y + 1};
......
......@@ -260,7 +260,7 @@ START_TEST(trackball_rotation_accel)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_trackball(void)
{
litest_add("trackball:rotation", trackball_rotation_config_defaults, LITEST_TRACKBALL, LITEST_ANY);
litest_add("trackball:rotation", trackball_rotation_config_invalid_range, LITEST_TRACKBALL, LITEST_ANY);
......
......@@ -281,7 +281,7 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_both)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_trackpoint(void)
{
litest_add("trackpoint:middlebutton", trackpoint_middlebutton, LITEST_POINTINGSTICK, LITEST_ANY);
litest_add("trackpoint:middlebutton", trackpoint_middlebutton_noscroll, LITEST_POINTINGSTICK, LITEST_ANY);
......
......@@ -507,7 +507,7 @@ START_TEST(udev_seat_recycle)
END_TEST
void
litest_setup_tests(void)
litest_setup_tests_udev(void)
{
litest_add_no_device("udev:create", udev_create_NULL);
litest_add_no_device("udev:create", udev_create_seat0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment