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.
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 = \
src/core/org.freedesktop.systemd1.policy.in
# ------------------------------------------------------------------------------
-noinst_PROGRAMS += \
+manual_tests += \
test-engine \
test-ns \
test-loopback \
test-watchdog \
test-log
-noinst_tests += \
+tests += \
test-job-type \
test-env-replace \
test-strbuf \
libsystemd-core.la
if ENABLE_EFI
-noinst_PROGRAMS += \
+manual_tests += \
test-efivars
test_efivars_SOURCES = \
noinst_LTLIBRARIES += \
libsystemd-bus.la
-noinst_tests += \
+tests += \
test-bus-marshal \
test-bus-signature \
test-bus-chat \
test/udev-test.pl \
test/rules-test.sh
-noinst_PROGRAMS += \
+manual_tests += \
test-libudev \
test-udev
libsystemd-shared.la \
libsystemd-id128-internal.la
-noinst_tests += \
+tests += \
test-id128
pkginclude_HEADERS += \
UNINSTALL_DATA_HOOKS += \
catalog-remove-hook
-noinst_PROGRAMS += \
+manual_tests += \
test-journal-enum
-noinst_tests += \
+tests += \
test-journal \
test-journal-send \
test-journal-syslog \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)
-noinst_PROGRAMS += \
+manual_tests += \
test-login \
test-inhibit
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])