summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin@piware.de>2017-02-12 23:53:53 +0100
committerMartin Pitt <martin@piware.de>2017-02-13 22:40:11 +0100
commit4f8425b8d5a3fb2e5ec24b77f1a7a95db55f532c (patch)
treed2459b2c13bbab470aa9758bb627c2242212e1ed
parentf853c6efb509589c8e3a82caa3af2ac5a370ae97 (diff)
buildsys: add "install-tests" target
Add a new "install-tests" make target that installs our unit test-* executables and their test data files into /usr/lib/systemd/tests/. This is useful for packaging the tests to run them with root privileges or in CI. Fixes #5257
-rw-r--r--Makefile.am22
1 files changed, 20 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 489cf3c1b7..c45755f36e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,6 +93,7 @@ kernelinstalldir = $(prefix)/lib/kernel/install.d
factory_etcdir = $(datadir)/factory/etc
factory_pamdir = $(datadir)/factory/etc/pam.d
bootlibdir = $(prefix)/lib/systemd/boot/efi
+testsdir = $(prefix)/lib/systemd/tests
# And these are the special ones for /
rootprefix=@rootprefix@
@@ -133,6 +134,7 @@ check_DATA =
dist_rootlibexec_DATA =
tests=
manual_tests =
+TEST_DATA_FILES =
TEST_EXTENSIONS = .py
PY_LOG_COMPILER = $(PYTHON)
DISABLE_HARD_ERRORS = yes
@@ -1606,7 +1608,7 @@ tests += \
test-seccomp
endif
-EXTRA_DIST += \
+TEST_DATA_FILES += \
test/a.service \
test/basic.target \
test/b.service \
@@ -5649,7 +5651,7 @@ test_dns_packet_LDADD = \
$(GCRYPT_LIBS) \
-lm
-EXTRA_DIST += \
+TEST_DATA_FILES += \
test/test-resolve/_openpgpkey.fedoraproject.org.pkts \
test/test-resolve/fedoraproject.org.pkts \
test/test-resolve/gandi.net.pkts \
@@ -5662,6 +5664,8 @@ EXTRA_DIST += \
test/test-resolve/kyhwana.org.pkts \
test/test-resolve/fake-caa.pkts
+EXTRA_DIST += $(TEST_DATA_FILES)
+
test_dnssec_SOURCES = \
src/resolve/test-dnssec.c \
$(basic_dns_sources)
@@ -6694,6 +6698,20 @@ tests += \
test-libsystemd-sym \
test-libudev-sym
+.PHONY: install-tests
+install-tests: $(tests) $(TEST_DATA_FILES)
+ for f in $(tests); do \
+ if [ -x .libs/$$f ]; then \
+ install -D -m 755 .libs/$$f $(DESTDIR)/$(testsdir)/$$f; \
+ else \
+ install -D -m 755 $$f $(DESTDIR)/$(testsdir)/$$f; \
+ fi; \
+ done
+ for f in $(TEST_DATA_FILES); do \
+ install -D -m 644 $$f $(DESTDIR)/$(testsdir)/testdata/$${f#test/}; \
+ done
+
+
.PHONY: cppcheck
cppcheck:
cppcheck --enable=all -q $(top_srcdir)