[systemd-devel] [PATCH v3] buildsys: Add --disable-tests to avoid building tests
Henrik Grindal Bakken
hgb at ifi.uio.no
Wed Apr 17 10:36:47 PDT 2013
This patch adds --disable-tests to configure. It is based on a patch
posted by Thierry Reding in 2010. The motivation for adding it is that
some tests fail link-time when cross-compiling.
The patch adds a new Makefile variable -- noinst_test_programs -- and uses
that instead of noinst_PROGRAMS. However, if ENABLE_TESTS is true,
the former is added to the latter.
---
Makefile.am | 18 ++++++++++++------
configure.ac | 5 +++++
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 7b4b2d8..89b95ba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -125,8 +125,14 @@ dist_dbussystemservice_DATA =
check_PROGRAMS =
check_DATA =
noinst_tests=
-noinst_PROGRAMS = $(noinst_tests)
+noinst_test_programs =
+if ENABLE_TESTS
+noinst_PROGRAMS = $(noinst_test_programs) $(noinst_tests)
TESTS = $(noinst_tests)
+else
+noinst_PROGRAMS =
+TESTS =
+endif
udevlibexec_PROGRAMS =
AM_CPPFLAGS = \
@@ -1063,7 +1069,7 @@ CLEANFILES += \
src/core/org.freedesktop.systemd1.policy.in
# ------------------------------------------------------------------------------
-noinst_PROGRAMS += \
+noinst_test_programs += \
test-engine \
test-ns \
test-loopback \
@@ -1145,7 +1151,7 @@ test_hostname_LDADD = \
libsystemd-core.la
if ENABLE_EFI
-noinst_PROGRAMS += \
+noinst_test_programs += \
test-efivars
test_efivars_SOURCES = \
@@ -2074,7 +2080,7 @@ TESTS += \
test/udev-test.pl \
test/rules-test.sh
-noinst_PROGRAMS += \
+noinst_test_programs += \
test-libudev \
test-udev
@@ -2835,7 +2841,7 @@ catalog-remove-hook:
UNINSTALL_DATA_HOOKS += \
catalog-remove-hook
-noinst_PROGRAMS += \
+noinst_test_programs += \
test-journal-enum
noinst_tests += \
@@ -3536,7 +3542,7 @@ test_inhibit_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)
-noinst_PROGRAMS += \
+noinst_test_programs += \
test-login \
test-inhibit
diff --git a/configure.ac b/configure.ac
index 519f1a9..fbc07c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -880,6 +880,11 @@ AS_IF([test "x$0" != "x./configure"], [
AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
])
+AC_ARG_ENABLE(tests,
+ [AC_HELP_STRING([--disable-tests], [build tests])],
+ enable_tests=$enableval, enable_tests=yes)
+AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
+
AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
--
1.7.10.1
More information about the systemd-devel
mailing list