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 95a16ea..7fd9c23 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 ee68614..4763ee1 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 e06aa4b..eb1b946 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 \