diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-12-06 15:02:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-01-15 11:59:27 +1000 |
commit | 3a344169bb2db9976655062f90b21d046780a2c5 (patch) | |
tree | 9e860ab5d70b1f3115fcb58411f4dd8f5f41c568 /configure.ac | |
parent | 86a50bccea0a757cbfddd0040acb6ec3d169fbc8 (diff) |
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>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 0d34623..7281bb4 100644 --- a/configure.ac +++ b/configure.ac @@ -60,9 +60,24 @@ fi AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$have_doxygen" = "xyes"]) AC_ARG_ENABLE(tests, - AS_HELP_STRING([--enable-tests], [Build the tests (default=yes)]), + AS_HELP_STRING([--enable-tests], [Build the tests (default=auto)]), [build_tests="$enableval"], - [build_tests="yes"]) + [build_tests="auto"]) + +PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4], [HAVE_LIBEVDEV="yes"], [HAVE_LIBEVDEV="no"]) +PKG_CHECK_MODULES(CHECK, [check >= 0.9.9], [HAVE_CHECK="yes"], [HAVE_CHECK="no"]) + +if test "x$build_tests" = "xauto"; then + if test "x$HAVE_CHECK" = "xyes" -a "x$HAVE_LIBEVDEV" = "xyes"; then + build_tests="yes" + fi +fi +if test "x$build_tests" = "xyes" -a "x$HAVE_CHECK" = "xno"; then + AC_MSG_ERROR([Cannot build tests, check is missing]) +fi +if test "x$build_tests" = "xyes" -a "x$HAVE_LIBEVDEV" = "xno"; then + AC_MSG_ERROR([Cannot build tests, libevdev is missing]) +fi AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"]) |