python: Wrap 'gpgme_op_keylist_from_data_start'.
[gpgme.git] / lang / python / tests / Makefile.am
1 # Makefile.am for the tests of the Python bindings.
2 # Copyright (C) 2016 g10 Code GmbH
3 #
4 # This file is part of GPGME.
5 #
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.
10 #
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.
15 #
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/>.
18
19 GPG = gpg
20 GPG_AGENT = gpg-agent
21 export GNUPGHOME := $(abs_builddir)
22 export GPG_AGENT_INFO :=
23
24 test_srcdir = $(top_srcdir)/tests/gpg
25
26 TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) \
27         LC_ALL=C GPG_AGENT_INFO= \
28         top_srcdir=$(top_srcdir) \
29         srcdir=$(srcdir) \
30         LD_LIBRARY_PATH="../../../src/.libs:$(LD_LIBRARY_PATH)"
31
32 py_tests = t-wrapper.py \
33         t-callbacks.py \
34         t-data.py \
35         t-encrypt.py \
36         t-encrypt-sym.py \
37         t-encrypt-sign.py \
38         t-sign.py \
39         t-signers.py \
40         t-decrypt.py \
41         t-verify.py \
42         t-decrypt-verify.py \
43         t-sig-notation.py \
44         t-export.py \
45         t-import.py \
46         t-trustlist.py \
47         t-edit.py \
48         t-keylist.py \
49         t-keylist-from-data.py \
50         t-wait.py \
51         t-encrypt-large.py \
52         t-file-name.py \
53         t-idiomatic.py \
54         t-protocol-assuan.py \
55         t-quick-key-creation.py \
56         t-quick-subkey-creation.py \
57         t-quick-key-manipulation.py \
58         t-quick-key-signing.py
59
60 XTESTS = initial.py $(py_tests) final.py
61 EXTRA_DIST = support.py $(XTESTS) encrypt-only.asc sign-only.asc \
62              run-tests.py
63
64 # XXX: Currently, one cannot override automake's 'check' target.  As a
65 # workaround, we avoid defining 'TESTS', thus automake will not emit
66 # the 'check' target.  For extra robustness, we merely define a
67 # dependency on 'xcheck', so this hack should also work even if
68 # automake would emit the 'check' target, as adding dependencies to
69 # targets is okay.
70 check: xcheck
71
72 .PHONY: xcheck
73
74 xcheck: ./pubring-stamp
75         $(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
76           --interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
77           $(XTESTS)
78
79 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
80         gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \
81         random_seed .gpg-v21-migrated tofu.db \
82         pubring-stamp private-keys-v1.d/gpg-sample.stamp
83
84 private_keys = \
85         $(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
86         $(test_srcdir)/76F7E2B35832976B50A27A282D9B87E44577EB66 \
87         $(test_srcdir)/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
88         $(test_srcdir)/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
89         $(test_srcdir)/7A030357C0F253A5BBCD282FFC4E521B37558F5C
90
91 clean-local:
92         -$(top_srcdir)/tests/start-stop-agent --stop
93         -rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
94
95
96 ./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
97         $(MKDIR_P) ./private-keys-v1.d
98         for k in $(private_keys); do \
99           cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
100         done
101         echo x > ./private-keys-v1.d/gpg-sample.stamp
102
103 ./pubring-stamp: $(test_srcdir)/pubdemo.asc           \
104                  ./gpg.conf ./gpg-agent.conf          \
105                  ./private-keys-v1.d/gpg-sample.stamp
106         $(GPG) --batch --no-permission-warning \
107                --import $(test_srcdir)/pubdemo.asc
108         -$(GPG) --batch --no-permission-warning \
109                 --import $(test_srcdir)/secdemo.asc
110         echo x > ./pubring-stamp
111
112 ./gpg.conf:
113 # This is required for t-sig-notations.
114         echo no-force-v3-sigs > ./gpg.conf
115         echo ignore-invalid-option agent-program >> ./gpg.conf
116         echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpg.conf
117
118 ./gpg-agent.conf:
119 # This is required for gpg2, which does not support command fd.
120         echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@