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