[PATCH libevdev] Disable test runs on make distcheck

Peter Hutterer peter.hutterer at who-t.net
Wed Nov 30 00:17:12 UTC 2016


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 at who-t.net>
---
 Makefile.am      | 2 ++
 configure.ac     | 6 ++++++
 test/Makefile.am | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 95a16ea..7fd9c23 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,3 +9,5 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libevdev.pc
 
 EXTRA_DIST = libevdev.pc.in
+
+AM_DISTCHECK_CONFIGURE_FLAGS = --disable-test-run
diff --git a/configure.ac b/configure.ac
index ee68614..4763ee1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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}
 	       ])
diff --git a/test/Makefile.am b/test/Makefile.am
index e06aa4b..eb1b946 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -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 \
-- 
2.9.3



More information about the Input-tools mailing list