chiark / gitweb /
buildsys: Add --disable-tests to avoid building tests
authorHenrik Grindal Bakken <hgb@ifi.uio.no>
Thu, 18 Apr 2013 12:40:24 +0000 (14:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Apr 2013 15:15:59 +0000 (17:15 +0200)
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 -- manual_tests -- and uses
that instead of noinst_PROGRAMS.  However, if ENABLE_TESTS is true,
the former is added to the latter.  It also renames noinst_tests to
simply tests.

Makefile.am
configure.ac

index 7b4b2d8c48a832b1949de6dbba0c1593d208d83a..80d0f1fb8b01ccd0f3b90d3c78820d74b632526c 100644 (file)
@@ -124,9 +124,15 @@ dbusinterface_DATA =
 dist_dbussystemservice_DATA =
 check_PROGRAMS =
 check_DATA =
-noinst_tests=
-noinst_PROGRAMS = $(noinst_tests)
-TESTS = $(noinst_tests)
+tests=
+manual_tests =
+if ENABLE_TESTS
+noinst_PROGRAMS = $(manual_tests) $(tests)
+TESTS = $(tests)
+else
+noinst_PROGRAMS =
+TESTS =
+endif
 udevlibexec_PROGRAMS =
 
 AM_CPPFLAGS = \
@@ -1063,7 +1069,7 @@ CLEANFILES += \
        src/core/org.freedesktop.systemd1.policy.in
 
 # ------------------------------------------------------------------------------
-noinst_PROGRAMS += \
+manual_tests += \
        test-engine \
        test-ns \
        test-loopback \
@@ -1074,7 +1080,7 @@ noinst_PROGRAMS += \
        test-watchdog \
        test-log
 
-noinst_tests += \
+tests += \
        test-job-type \
        test-env-replace \
        test-strbuf \
@@ -1145,7 +1151,7 @@ test_hostname_LDADD = \
        libsystemd-core.la
 
 if ENABLE_EFI
-noinst_PROGRAMS += \
+manual_tests += \
        test-efivars
 
 test_efivars_SOURCES = \
@@ -1726,7 +1732,7 @@ libsystemd_bus_la_LIBADD =  \
 noinst_LTLIBRARIES += \
        libsystemd-bus.la
 
-noinst_tests += \
+tests += \
        test-bus-marshal \
        test-bus-signature \
        test-bus-chat \
@@ -2074,7 +2080,7 @@ TESTS += \
        test/udev-test.pl \
        test/rules-test.sh
 
-noinst_PROGRAMS += \
+manual_tests += \
        test-libudev \
        test-udev
 
@@ -2527,7 +2533,7 @@ test_id128_LDADD = \
        libsystemd-shared.la \
        libsystemd-id128-internal.la
 
-noinst_tests += \
+tests += \
        test-id128
 
 pkginclude_HEADERS += \
@@ -2835,10 +2841,10 @@ catalog-remove-hook:
 UNINSTALL_DATA_HOOKS += \
        catalog-remove-hook
 
-noinst_PROGRAMS += \
+manual_tests += \
        test-journal-enum
 
-noinst_tests += \
+tests += \
        test-journal \
        test-journal-send \
        test-journal-syslog \
@@ -3536,7 +3542,7 @@ test_inhibit_CFLAGS = \
        $(AM_CFLAGS) \
        $(DBUS_CFLAGS)
 
-noinst_PROGRAMS += \
+manual_tests += \
        test-login \
        test-inhibit
 
index 519f1a95e0d4cb79c6fd1ab6cc64582e88002726..aec85ea6155c2808d24d249e2c557b7611c963c1 100644 (file)
@@ -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], [disable 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])