Fix for bug 1223
[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 = version.test mds.test \
27         decrypt.test decrypt-dsa.test \
28         sigs.test sigs-dsa.test \
29         encrypt.test encrypt-dsa.test  \
30         seat.test clearsig.test encryptp.test detach.test \
31         armsigs.test armencrypt.test armencryptp.test \
32         signencrypt.test signencrypt-dsa.test \
33         armsignencrypt.test armdetach.test \
34         armdetachm.test detachm.test genkey1024.test \
35         conventional.test conventional-mdc.test \
36         multisig.test verify.test armor.test \
37         import.test
38
39
40 TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \
41              plain-1.asc plain-2.asc plain-3.asc plain-1-pgp.asc \
42              pubring.pkr.asc secring.skr.asc secdemo.asc pubdemo.asc \
43              gpg.conf.tmpl bug537-test.data.asc bug894-test.asc \
44              bug1223-good.asc bug1223-bogus.asc
45
46 DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large
47
48 EXTRA_DIST = defs.inc $(TESTS) $(TEST_FILES) \
49              mkdemodirs signdemokey
50 CLEANFILES = prepared.stamp x y yy z out err  $(DATA_FILES) \
51              plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \
52              *.test.log gpg_dearmor gpg.conf \
53              pubring.gpg secring.gpg pubring.pkr secring.skr
54
55 DISTCLEANFILES = pubring.gpg~ random_seed
56
57
58 all-local: prepared.stamp
59
60 distclean-local:
61         $(srcdir)/mkdemodirs --clean
62
63 prepared.stamp: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \
64                 ./pubring.pkr ./secring.skr ./gpg_dearmor $(DATA_FILES)
65          $(GPG_IMPORT) $(srcdir)/pubdemo.asc     
66          echo timestamp >./prepared.stamp
67
68 # We need to depend on a couple of programs so that the tests don't
69 # start before all programs are built.
70 ./gpg_dearmor:  $(required_pgms)
71         echo '#!/bin/sh' >./gpg_dearmor
72         echo "../../g10/gpg2 --no-options --no-greeting \
73              --no-secmem-warning --batch --dearmor" >>./gpg_dearmor
74         chmod 755 ./gpg_dearmor
75
76 ./pubring.gpg: $(srcdir)/pubring.asc $(srcdir)/pubdemo.asc ./gpg_dearmor
77         ./gpg_dearmor > ./pubring.gpg < $(srcdir)/pubring.asc
78
79 ./secring.gpg: $(srcdir)/secring.asc ./gpg_dearmor
80         ./gpg_dearmor > ./secring.gpg < $(srcdir)/secring.asc
81
82 ./pubring.pkr: $(srcdir)/pubring.pkr.asc ./gpg_dearmor
83         ./gpg_dearmor > ./pubring.pkr < $(srcdir)/pubring.pkr.asc
84
85 ./secring.skr: $(srcdir)/secring.skr.asc ./gpg_dearmor
86         ./gpg_dearmor > ./secring.skr < $(srcdir)/secring.skr.asc
87
88 ./plain-1: $(srcdir)/plain-1o.asc ./gpg_dearmor
89         ./gpg_dearmor > ./plain-1 < $(srcdir)/plain-1o.asc
90
91 ./plain-2: $(srcdir)/plain-2o.asc ./gpg_dearmor
92         ./gpg_dearmor > ./plain-2 < $(srcdir)/plain-2o.asc
93
94 ./plain-3: $(srcdir)/plain-3o.asc ./gpg_dearmor
95         ./gpg_dearmor > ./plain-3 < $(srcdir)/plain-3o.asc
96
97
98 data-500:
99         ../../tools/mk-tdata   500  >data-500
100 data-9000:
101         ../../tools/mk-tdata  9000  >data-9000
102 data-32000:
103         ../../tools/mk-tdata 32000  >data-32000
104 data-80000:
105         ../../tools/mk-tdata 80000  >data-80000
106 plain-large:
107         cat $(srcdir)/../../doc/HACKING \
108             $(srcdir)/../../doc/DETAILS \
109             $(srcdir)/../../doc/gpg.texi >plain-large
110
111 # To speed up key generation we create a dummy random seed file
112 random_seed:
113         ../../tools/mk-tdata 600
114