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 <wk@gnupg.org>
This commit is contained in:
parent
bfb6890ded
commit
0763357e39
@ -25,7 +25,7 @@ EXTRA_DIST = \
|
|||||||
examples \
|
examples \
|
||||||
pyme
|
pyme
|
||||||
|
|
||||||
SUBDIRS = tests
|
SUBDIRS = . tests
|
||||||
|
|
||||||
COPY_FILES = \
|
COPY_FILES = \
|
||||||
$(srcdir)/gpgme.i \
|
$(srcdir)/gpgme.i \
|
||||||
|
@ -65,14 +65,16 @@ EXTRA_DIST = support.py $(XTESTS) encrypt-only.asc sign-only.asc \
|
|||||||
check: xcheck
|
check: xcheck
|
||||||
|
|
||||||
.PHONY: xcheck
|
.PHONY: xcheck
|
||||||
xcheck:
|
|
||||||
|
xcheck: ./pubring-stamp
|
||||||
$(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
|
$(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
|
||||||
--interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
|
--interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
|
||||||
$(XTESTS)
|
$(XTESTS)
|
||||||
|
|
||||||
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
|
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
|
||||||
gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \
|
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 = \
|
private_keys = \
|
||||||
$(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
|
$(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
|
||||||
@ -85,21 +87,17 @@ clean-local:
|
|||||||
-$(top_srcdir)/tests/start-stop-agent --stop
|
-$(top_srcdir)/tests/start-stop-agent --stop
|
||||||
-rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
|
-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)
|
./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
|
||||||
test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
|
test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
|
||||||
for k in $(private_keys); do \
|
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
|
done
|
||||||
echo x > ./private-keys-v1.d/gpg-sample.stamp
|
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 \
|
$(GPG) --batch --no-permission-warning \
|
||||||
--import $(test_srcdir)/pubdemo.asc
|
--import $(test_srcdir)/pubdemo.asc
|
||||||
-$(GPG) --batch --no-permission-warning \
|
-$(GPG) --batch --no-permission-warning \
|
||||||
|
Loading…
Reference in New Issue
Block a user