From 0763357e39d140b068ee9838a5da08be75426d9f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 20 Sep 2016 19:58:00 +0200 Subject: [PATCH] tests: Make "make -j distcheck" work in Python. * lang/python/Makefile.am (SUBDIRS): Make current dir fist. * lang/python/tests/Makefile.am (xcheck): Depend on pubring-stamp. (CLEANFILES): Remove private-keys-v1.d/gpg-sample.stamp. (check-local): Remove. (initial.py): Remove dependency. (./pubring-stamp): Depend on conf files and the private-keys-v1.d/gpg-sample.stamp file. Also replace use of basename. -- This addresses the problem that two rules might run the private keys copy rule and due to the files being chmod -w during make discheck the second process running that rule's cp would get a permission error. Signed-off-by: Werner Koch --- lang/python/Makefile.am | 2 +- lang/python/tests/Makefile.am | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am index da626d1b..897c2a6d 100644 --- a/lang/python/Makefile.am +++ b/lang/python/Makefile.am @@ -25,7 +25,7 @@ EXTRA_DIST = \ examples \ pyme -SUBDIRS = tests +SUBDIRS = . tests COPY_FILES = \ $(srcdir)/gpgme.i \ diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am index 0538e54f..aa88bdcb 100644 --- a/lang/python/tests/Makefile.am +++ b/lang/python/tests/Makefile.am @@ -65,14 +65,16 @@ EXTRA_DIST = support.py $(XTESTS) encrypt-only.asc sign-only.asc \ check: xcheck .PHONY: xcheck -xcheck: + +xcheck: ./pubring-stamp $(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \ --interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \ $(XTESTS) CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \ - random_seed .gpg-v21-migrated pubring-stamp + random_seed .gpg-v21-migrated \ + pubring-stamp private-keys-v1.d/gpg-sample.stamp private_keys = \ $(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \ @@ -85,21 +87,17 @@ clean-local: -$(top_srcdir)/tests/start-stop-agent --stop -rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol -check-local: ./gpg.conf ./gpg-agent.conf ./pubring-stamp \ - ./private-keys-v1.d/gpg-sample.stamp - -# To guarantee that check-local is run before any tests we -# add this dependency: -initial.py: check-local ./private-keys-v1.d/gpg-sample.stamp: $(private_keys) test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d for k in $(private_keys); do \ - cp $$k private-keys-v1.d/`basename $$k`.key; \ + cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \ done echo x > ./private-keys-v1.d/gpg-sample.stamp -./pubring-stamp: $(test_srcdir)/pubdemo.asc +./pubring-stamp: $(test_srcdir)/pubdemo.asc \ + ./gpg.conf ./gpg-agent.conf \ + ./private-keys-v1.d/gpg-sample.stamp $(GPG) --batch --no-permission-warning \ --import $(test_srcdir)/pubdemo.asc -$(GPG) --batch --no-permission-warning \