1 # Makefile.am for the tests of the Python bindings.
2 # Copyright (C) 2016 g10 Code GmbH
4 # This file is part of GPGME.
6 # GPGME is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # GPGME is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 # Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
22 test_srcdir = $(top_srcdir)/tests/gpg
24 GNUPGHOME=$(abs_builddir)
25 TESTS_ENVIRONMENT = GNUPGHOME=$(GNUPGHOME) \
26 LC_ALL=C GPG_AGENT_INFO= \
27 top_srcdir=$(top_srcdir) \
29 LD_LIBRARY_PATH="../../../src/.libs:$(LD_LIBRARY_PATH)"
31 py_tests ?= t-wrapper.py \
47 t-keylist-from-data.py \
52 t-protocol-assuan.py \
53 t-quick-key-creation.py \
54 t-quick-subkey-creation.py \
55 t-quick-key-manipulation.py \
56 t-quick-key-signing.py
58 XTESTS = initial.py $(py_tests) final.py
59 EXTRA_DIST = support.py $(XTESTS) encrypt-only.asc sign-only.asc \
62 # XXX: Currently, one cannot override automake's 'check' target. As a
63 # workaround, we avoid defining 'TESTS', thus automake will not emit
64 # the 'check' target. For extra robustness, we merely define a
65 # dependency on 'xcheck', so this hack should also work even if
66 # automake would emit the 'check' target, as adding dependencies to
73 $(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
74 --interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
77 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
78 gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \
79 random_seed .gpg-v21-migrated tofu.db \
80 pubring-stamp gpg-sample.stamp
83 $(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
84 $(test_srcdir)/76F7E2B35832976B50A27A282D9B87E44577EB66 \
85 $(test_srcdir)/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
86 $(test_srcdir)/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
87 $(test_srcdir)/7A030357C0F253A5BBCD282FFC4E521B37558F5C
90 -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop
91 -rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
94 BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
97 gpg-sample.stamp: $(private_keys)
98 -$(TESTS_ENVIRONMENT) gpgconf --kill all
99 $(MKDIR_P) ./private-keys-v1.d
100 for k in $(private_keys); do \
101 cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
103 echo x > ./gpg-sample.stamp
105 pubring-stamp: $(test_srcdir)/pubdemo.asc gpg-sample.stamp
106 $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \
107 --import $(test_srcdir)/pubdemo.asc
108 -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \
109 --import $(test_srcdir)/secdemo.asc
110 -$(TESTS_ENVIRONMENT) gpgconf --kill all
111 echo x > ./pubring-stamp
114 # This is required for t-sig-notations.
115 echo no-force-v3-sigs > ./gpg.conf
116 echo default-key A0FF4590BB6122EDEF6E3C542D727CC768697734 >> ./gpg.conf
119 # This is required for gpg2, which does not support command fd.
120 echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@
121 echo disable-scdaemon >> $@