Change OpenPGP test framework to run under the control of the agent.
[gnupg.git] / tests / openpgp / Makefile.am
1 # Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
2 #
3 # This file is part of GnuPG.
4 #
5 # GnuPG is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9
10 # GnuPG is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 # Process this file with automake to create Makefile.in
18
19 GPG_IMPORT = ../../g10/gpg2 --homedir . \
20               --quiet --yes --no-permission-warning --import
21
22 # Programs required before we can run these tests.
23 required_pgms = ../../g10/gpg2 ../../agent/gpg-agent \
24                 ../../tools/gpg-connect-agent
25
26 TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= LC_ALL=C \
27                     ../../agent/gpg-agent --quiet --daemon sh
28
29 TESTS = version.test mds.test \
30         decrypt.test decrypt-dsa.test \
31         sigs.test sigs-dsa.test \
32         encrypt.test encrypt-dsa.test  \
33         seat.test clearsig.test encryptp.test detach.test \
34         armsigs.test armencrypt.test armencryptp.test \
35         signencrypt.test signencrypt-dsa.test \
36         armsignencrypt.test armdetach.test \
37         armdetachm.test detachm.test genkey1024.test \
38         conventional.test conventional-mdc.test \
39         multisig.test verify.test armor.test \
40         import.test
41
42
43 TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \
44              plain-1.asc plain-2.asc plain-3.asc plain-1-pgp.asc \
45              pubring.pkr.asc secring.skr.asc secdemo.asc pubdemo.asc \
46              gpg.conf.tmpl gpg-agent.conf.tmpl \
47              bug537-test.data.asc bug894-test.asc \
48              bug1223-good.asc bug1223-bogus.asc
49
50 DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large
51
52 EXTRA_DIST = defs.inc $(TESTS) $(TEST_FILES) \
53              mkdemodirs signdemokey
54
55 CLEANFILES = prepared.stamp x y yy z out err  $(DATA_FILES) \
56              plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \
57              *.test.log gpg_dearmor gpg.conf gpg-agent.conf S.gpg-agent \
58              pubring.gpg secring.gpg pubring.pkr secring.skr
59
60 DISTCLEANFILES = pubring.gpg~ random_seed
61
62
63 all-local: prepared.stamp
64
65 distclean-local:
66         $(srcdir)/mkdemodirs --clean
67
68 prepared.stamp: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \
69                 ./pubring.pkr ./secring.skr ./gpg_dearmor $(DATA_FILES)
70          $(GPG_IMPORT) $(srcdir)/pubdemo.asc     
71          cat $(srcdir)/gpg-agent.conf.tmpl > gpg-agent.conf
72          echo timestamp >./prepared.stamp
73
74 # We need to depend on a couple of programs so that the tests don't
75 # start before all programs are built.
76 ./gpg_dearmor:  $(required_pgms)
77         echo '#!/bin/sh' >./gpg_dearmor
78         echo "../../g10/gpg2 --no-options --no-greeting \
79              --no-secmem-warning --batch --dearmor" >>./gpg_dearmor
80         chmod 755 ./gpg_dearmor
81
82 ./pubring.gpg: $(srcdir)/pubring.asc $(srcdir)/pubdemo.asc ./gpg_dearmor
83         ./gpg_dearmor > ./pubring.gpg < $(srcdir)/pubring.asc
84
85 ./secring.gpg: $(srcdir)/secring.asc ./gpg_dearmor
86         ./gpg_dearmor > ./secring.gpg < $(srcdir)/secring.asc
87
88 ./pubring.pkr: $(srcdir)/pubring.pkr.asc ./gpg_dearmor
89         ./gpg_dearmor > ./pubring.pkr < $(srcdir)/pubring.pkr.asc
90
91 ./secring.skr: $(srcdir)/secring.skr.asc ./gpg_dearmor
92         ./gpg_dearmor > ./secring.skr < $(srcdir)/secring.skr.asc
93
94 ./plain-1: $(srcdir)/plain-1o.asc ./gpg_dearmor
95         ./gpg_dearmor > ./plain-1 < $(srcdir)/plain-1o.asc
96
97 ./plain-2: $(srcdir)/plain-2o.asc ./gpg_dearmor
98         ./gpg_dearmor > ./plain-2 < $(srcdir)/plain-2o.asc
99
100 ./plain-3: $(srcdir)/plain-3o.asc ./gpg_dearmor
101         ./gpg_dearmor > ./plain-3 < $(srcdir)/plain-3o.asc
102
103
104 data-500:
105         ../../tools/mk-tdata   500  >data-500
106 data-9000:
107         ../../tools/mk-tdata  9000  >data-9000
108 data-32000:
109         ../../tools/mk-tdata 32000  >data-32000
110 data-80000:
111         ../../tools/mk-tdata 80000  >data-80000
112 plain-large:
113         cat $(srcdir)/../../doc/HACKING \
114             $(srcdir)/../../doc/DETAILS \
115             $(srcdir)/../../doc/gpg.texi >plain-large
116
117 # To speed up key generation we create a dummy random seed file
118 random_seed:
119         ../../tools/mk-tdata 600
120