aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Makefile.am
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-09-30 16:18:00 +0000
committerWerner Koch <[email protected]>2021-10-01 12:46:16 +0000
commit399ebf6d873d4178c1d527aa4df34bf16a76360e (patch)
treeea229ce5301893efca5f69ee19a2e898609b2a30 /tests/Makefile.am
parentcommon: Support gpgconf.ctl also for BSDs. (diff)
downloadgnupg-399ebf6d873d4178c1d527aa4df34bf16a76360e.tar.gz
gnupg-399ebf6d873d4178c1d527aa4df34bf16a76360e.zip
build: Prepare for using installed versions for tests.
* tests/gpgconf.ctl.in: New. * tests/Makefile.am (EXTRA_DIST): Add new file. (TESTINST_DIRS): New. (clean-local): New. (clean-local-testinst): New. (check-recursive): New hook. (bin/gpgconf.ctl): Run a test install. * tests/cms/Makefile.am (TESTS_ENVIRONMENT): Set new envvar GNUPG_BUILD_ROOT. * tests/gpgme/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/pkits/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Ditto. -- Right now this helps only with the global configuraion dir which is now not set and thus the build host'ss own /etc/gnupg does not anymore affect the build. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f29b68a53..d26ef9df1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,7 +29,7 @@ SUBDIRS = gpgscm openpgp cms migrations gpgme pkits $(tpm2dtests) .
GPGSM = ../sm/gpgsm
-EXTRA_DIST = run-tests.scm \
+EXTRA_DIST = run-tests.scm gpgconf.ctl.in \
fake-pinentries/README.txt \
fake-pinentries/fake-pinentry.php \
fake-pinentries/fake-pinentry.pl \
@@ -44,3 +44,31 @@ noinst_PROGRAMS = asschk
endif
asschk_SOURCES = asschk.c
+
+TESTINST_DIRS = bin sbin libexec share etc
+
+clean-local: clean-local-testinst
+
+# We do a cd ../tests here so that we make sure tha the bin dir etc
+# are under our tests dir. This is failsafe thingy in case this
+# Makefile rule is accidently run /.
+clean-local-testinst:
+ -(cd ../tests && rm -rf $(TESTINST_DIRS))
+
+# Before we can run any tests we need to make sure that we have a
+# proper test installation with this dir (tests) as root dir. It is
+# too hard to track the built files here thus we do the install step
+# always.
+check-recursive: bin/gpgconf.ctl
+
+bin/gpgconf.ctl: FORCE
+ @echo '==== Installing into a test root ======'
+ @-mkdir bin 2>/dev/null
+ @cat $(srcdir)/gpgconf.ctl.in > bin/gpgconf.ctl.tmp
+ cd .. && \
+ $(MAKE) $(AM_MAKEFLAGS) install prefix=$(abs_top_builddir)/tests
+ @mv bin/gpgconf.ctl.tmp bin/gpgconf.ctl
+ @echo '==== Finished installing into a test root ======'
+
+
+.PHONY: FORCE clean-local-testinst