Disable test runs on make distcheck
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 30 Nov 2016 00:13:22 +0000 (10:13 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 30 Nov 2016 10:34:46 +0000 (20:34 +1000)
The tests all need root, but running distcheck as root is not ideal. Disable
the test runs (but not the build) to make it easier to verify distcheck works
as intended.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Makefile.am
configure.ac
test/Makefile.am

index 95a16eac422b9a62c2bd73ca2e662271c6daf976..7fd9c2323b77bdae65e7d94cb864f2e6ac8efef4 100644 (file)
@@ -9,3 +9,5 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libevdev.pc
 
 EXTRA_DIST = libevdev.pc.in
+
+AM_DISTCHECK_CONFIGURE_FLAGS = --disable-test-run
index ee6861432e5840a941137562d75bcc87ef494e14..4763ee1e580020ce295b9ea7ef68454f9acc1503 100644 (file)
@@ -79,6 +79,11 @@ AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
 AM_CONDITIONAL(ENABLE_RUNTIME_TESTS, [test "x$HAVE_CHECK" = "xyes"])
 AM_CONDITIONAL(ENABLE_STATIC_LINK_TEST, [test "x$enable_static" = "xyes"])
 
+AC_ARG_ENABLE([test-run],
+              AS_HELP_STRING([--enable-test-run], [For internal use only]),
+              [run_tests="$enableval"], [run_tests="yes"])
+AM_CONDITIONAL(RUN_TESTS, [test "x$run_tests" = "xyes"])
+
 with_cflags=""
 if test "x$GCC" = "xyes"; then
        CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
@@ -163,6 +168,7 @@ AC_MSG_RESULT([
 
               Build documentation              ${have_doxygen}
               Enable unit-tests                ${HAVE_CHECK}
+              Run unit-tests                   ${run_tests}
               Enable profiling                 ${enable_gcov}
               Static library symbol check      ${static_symbol_leaks_test}
               ])
index e06aa4b43534658e14d8171a179455a862f96877..eb1b946d4dce5fc3211b2c4b96c4d69a1069eeac 100644 (file)
@@ -31,7 +31,9 @@ run_tests = test-libevdev test-kernel
 
 noinst_PROGRAMS += $(run_tests)
 
+if RUN_TESTS
 TESTS = $(run_tests)
+endif
 
 libevdev_sources = $(top_srcdir)/libevdev/libevdev.c \
                   $(top_srcdir)/libevdev/libevdev.h \