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 <http://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 \
48 t-keylist-from-data.py \
53 t-protocol-assuan.py \
54 t-quick-key-creation.py \
55 t-quick-subkey-creation.py \
56 t-quick-key-manipulation.py \
57 t-quick-key-signing.py
59 XTESTS = initial.py $(py_tests) final.py
60 EXTRA_DIST = support.py $(XTESTS) encrypt-only.asc sign-only.asc \
63 # XXX: Currently, one cannot override automake's 'check' target. As a
64 # workaround, we avoid defining 'TESTS', thus automake will not emit
65 # the 'check' target. For extra robustness, we merely define a
66 # dependency on 'xcheck', so this hack should also work even if
67 # automake would emit the 'check' target, as adding dependencies to
74 $(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
75 --interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
78 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
79 gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \
80 random_seed .gpg-v21-migrated tofu.db \
81 pubring-stamp gpg-sample.stamp
84 $(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
85 $(test_srcdir)/76F7E2B35832976B50A27A282D9B87E44577EB66 \
86 $(test_srcdir)/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
87 $(test_srcdir)/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
88 $(test_srcdir)/7A030357C0F253A5BBCD282FFC4E521B37558F5C
91 -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop
92 -rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
95 BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
98 gpg-sample.stamp: $(private_keys)
99 -$(TESTS_ENVIRONMENT) gpgconf --kill all
100 $(MKDIR_P) ./private-keys-v1.d
101 for k in $(private_keys); do \
102 cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
104 echo x > ./gpg-sample.stamp
106 pubring-stamp: $(test_srcdir)/pubdemo.asc gpg-sample.stamp
107 $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \
108 --import $(test_srcdir)/pubdemo.asc
109 -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \
110 --import $(test_srcdir)/secdemo.asc
111 echo x > ./pubring-stamp
114 # This is required for t-sig-notations.
115 echo no-force-v3-sigs > ./gpg.conf
116 echo ignore-invalid-option agent-program >> ./gpg.conf
117 echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpg.conf
120 # This is required for gpg2, which does not support command fd.
121 echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@
122 echo disable-scdaemon >> $@