[Pkg-gnupg-commit] [gnupg2] 61/112: tests: Run each test in a clean environment.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Aug 30 17:48:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit e13f1ea8fff3964dc3008432f5c0f26aaa2eaa35
Author: Justus Winter <justus at g10code.com>
Date:   Wed Aug 10 09:32:53 2016 +0200

    tests: Run each test in a clean environment.
    
    * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Drop obsolete
    variables, add 'srcdir', use absolute paths.
    (TESTS): Rename to 'XTESTS' to avoid emitting the automake test
    runner.  Drop 'setup.scm' and 'finish.scm'.
    (xcheck): New target that runs 'run-tests.scm', our Scheme test suite
    runner.  It will run each test in a clean environment, isolated from
    the other tests.
    (EXTRA_DIST): Adapt accordingly.
    * tests/openpgp/README: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/openpgp/Makefile.am | 26 ++++++++++++++++++--------
 tests/openpgp/README      |  2 +-
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 564439a..a43f23b 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -36,16 +36,15 @@ fake_pinentry_SOURCES = fake-pinentry.c
 
 TMP ?= /tmp
 
-TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= LC_ALL=C \
+TESTS_ENVIRONMENT = LC_ALL=C \
 	EXEEXT=$(EXEEXT) \
 	PATH=../gpgscm:$(PATH) \
 	TMP=$(TMP) \
+	srcdir=$(abs_srcdir) \
 	objdir=$(abs_top_builddir) \
-	GPGSCM_PATH=$(top_srcdir)/tests/gpgscm:$(top_srcdir)/tests/openpgp
+	GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm:$(abs_top_srcdir)/tests/openpgp
 
-# Note: setup.scm needs to be the first test to run and finish.scm
-# the last one
-TESTS = setup.scm \
+XTESTS = \
 	version.scm \
 	mds.scm \
 	decrypt.scm \
@@ -85,9 +84,20 @@ TESTS = setup.scm \
 	ssh.scm \
 	issue2015.scm \
 	issue2346.scm \
-	issue2419.scm \
-	finish.scm
+	issue2419.scm
 
+# XXX: Currently, one cannot override automake's 'check' target.  As a
+# workaround, we avoid defining 'TESTS', thus automake will not emit
+# the 'check' target.  For extra robustness, we merely define a
+# dependency on 'xcheck', so this hack should also work even if
+# automake would emit the 'check' target, as adding dependencies to
+# targets is okay.
+check: xcheck
+
+.PHONY: xcheck
+xcheck:
+	$(TESTS_ENVIRONMENT) $(abs_top_builddir)/tests/gpgscm/gpgscm \
+	  run-tests.scm $(XTESTS)
 
 TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \
 	     plain-1.asc plain-2.asc plain-3.asc plain-1-pgp.asc \
@@ -158,7 +168,7 @@ sample_keys = samplekeys/README \
 
 sample_msgs = samplemsgs/issue2419.asc
 
-EXTRA_DIST = defs.inc defs.scm pinentry.sh $(TESTS) $(TEST_FILES) \
+EXTRA_DIST = defs.inc defs.scm pinentry.sh $(XTESTS) $(TEST_FILES) \
 	     mkdemodirs signdemokey $(priv_keys) $(sample_keys)   \
 	     $(sample_msgs) ChangeLog-2011 run-tests.scm
 
diff --git a/tests/openpgp/README b/tests/openpgp/README
index 1f8654b..9b384be 100644
--- a/tests/openpgp/README
+++ b/tests/openpgp/README
@@ -8,7 +8,7 @@ On POSIX you can just use
 
 or
 
-  $ make -C tests/openpgp check TESTS="setup.scm your-test.scm finish.scm"
+  $ make -C tests/openpgp check XTESTS="setup.scm your-test.scm finish.scm"
 
 as before.
 ** using the Scheme driver

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list