aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/tests/Makefile.am
blob: ee168b75e5534b7aa7e9b462fe4da2aac5872b90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# Makefile.am - Makefile for QGpgME tests.
# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
# Software engineering by Intevation GmbH
#
# This file is part of QGpgME.
#
# QGpgME is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# QGpgME is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0-or-later

## Process this file with automake to produce Makefile.in

GPG = gpg

GNUPGHOME=$(abs_builddir)
TESTS_ENVIRONMENT = GNUPGHOME=$(GNUPGHOME)

EXTRA_DIST = initial.test final.test

if WANT_QT5
the_tests5 = \
	t-addexistingsubkey5 \
	t-changeexpiryjob5 \
	t-config5 \
	t-decryptverify5 \
	t-disablekey5 \
	t-encrypt5 \
	t-import5 \
	t-keylist5 \
	t-keylocate5 \
	t-ownertrust5 \
	t-remarks5 \
	t-revokekey5 \
	t-setprimaryuserid5 \
	t-tofuinfo5 \
	t-trustsignatures5 \
	t-various5 \
	t-verify5 \
	t-wkdlookup5
# disabled test: t-wkspublish5
the_runners5 = \
	run-decryptverifyarchivejob5 \
	run-decryptverifyjob5 \
	run-encryptarchivejob5 \
	run-encryptjob5 \
	run-exportjob5 \
	run-importjob5 \
	run-keyformailboxjob5 \
	run-receivekeysjob5 \
	run-refreshkeysjob5 \
	run-signarchivejob5 \
	run-signjob5 \
	run-verifydetachedjob5 \
	run-verifyopaquejob5 \
	run-wkdrefreshjob5
endif
if WANT_QT6
the_tests6 = \
	t-addexistingsubkey6 \
	t-changeexpiryjob6 \
	t-config6 \
	t-decryptverify6 \
	t-disablekey6 \
	t-encrypt6 \
	t-import6 \
	t-keylist6 \
	t-keylocate6 \
	t-ownertrust6 \
	t-remarks6 \
	t-revokekey6 \
	t-setprimaryuserid6 \
	t-tofuinfo6 \
	t-trustsignatures6 \
	t-various6 \
	t-verify6 \
	t-wkdlookup6
# disabled test: t-wkspublish6
the_runners6 = \
	run-decryptverifyarchivejob6 \
	run-decryptverifyjob6 \
	run-encryptarchivejob6 \
	run-encryptjob6 \
	run-exportjob6 \
	run-importjob6 \
	run-keyformailboxjob6 \
	run-receivekeysjob6 \
	run-refreshkeysjob6 \
	run-signarchivejob6 \
	run-signjob6 \
	run-verifydetachedjob6 \
	run-verifyopaquejob6 \
	run-wkdrefreshjob6
endif

TESTS = initial.test $(the_tests5) $(the_tests6) final.test

# define .moc files for all tests; we'll moc their .cpp files
# the only header that needs to be moc'd (t-support.h) is handled individually
# moc_files = $(the_tests:%=%.moc)

# generate the moc files in two steps:
# 1. generate Qt 5/6-specific moc files in builddir with extension .moc5/.moc6;
#    this ensures correct dependencies on the source files
# 2. generate forwarding headers in subfolders moc5/moc6 with extension .moc;
#    this ensures that the "foo.moc" includes in the source files work and
#    include the correct version of the generated moc files for Qt 5/6
# GNU make's pattern rules would make this easier, but we don't want to use them
if WANT_QT5
moc5_dir = moc5
moc5_files = $(moc5_dir)/t-support.hmoc $(the_tests5:%5=%.moc5)
moc5_forward_headers = $(the_tests5:%5=$(moc5_dir)/%.moc)

$(moc5_dir)/t-support.hmoc: t-support.h | $(moc5_dir)
	$(MOC5) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

.cpp.moc5:
	$(MOC5) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

$(moc5_dir):
	mkdir $(moc5_dir)

$(moc5_forward_headers): Makefile.am | $(moc5_dir)
	echo "#include \"../$(notdir $@)5\"" > "$@"
endif
if WANT_QT6
moc6_dir = moc6
moc6_files = $(moc6_dir)/t-support.hmoc $(the_tests6:%6=%.moc6)
moc6_forward_headers = $(the_tests6:%6=$(moc6_dir)/%.moc)

$(moc6_dir)/t-support.hmoc: t-support.h | $(moc6_dir)
	$(MOC6) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

.cpp.moc6:
	$(MOC6) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

$(moc6_dir):
	mkdir $(moc6_dir)

$(moc6_forward_headers): Makefile.am | $(moc6_dir)
	echo "#include \"../$(notdir $@)6\"" > "$@"
endif

AM_LDFLAGS = -no-install

if WANT_QT5
ldadd_qt5 = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \
        ../../../src/libgpgme.la @GPGME_QT5_LIBS@ @GPG_ERROR_LIBS@ \
        @GPGME_QT5TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++

cppflags_qt5 = -I$(moc5_dir) -I$(top_srcdir)/lang/qt/src -I$(top_builddir)/lang/cpp/src \
              -I$(top_builddir)/src \
              @GPG_ERROR_CFLAGS@ @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ \
              @LIBASSUAN_CFLAGS@ @GPGME_QT5TEST_CFLAGS@ -DBUILDING_QGPGME \
              -DTOP_SRCDIR="$(top_srcdir)"
endif
if WANT_QT6
ldadd_qt6 = ../../cpp/src/libgpgmepp.la ../src/libqgpgmeqt6.la \
        ../../../src/libgpgme.la @GPGME_QT6_LIBS@ @GPG_ERROR_LIBS@ \
        @GPGME_QT6TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++

cppflags_qt6 = -I$(moc6_dir) -I$(top_srcdir)/lang/qt/src -I$(top_builddir)/lang/cpp/src \
              -I$(top_builddir)/src \
              @GPG_ERROR_CFLAGS@ @GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ \
              @LIBASSUAN_CFLAGS@ @GPGME_QT6TEST_CFLAGS@ -DBUILDING_QGPGME \
              -DTOP_SRCDIR="$(top_srcdir)"
endif

support_src = t-support.h t-support.cpp

if WANT_QT5
t_addexistingsubkey5_SOURCES = t-addexistingsubkey.cpp $(support_src)
t_addexistingsubkey5_LDADD = $(ldadd_qt5)
t_addexistingsubkey5_CPPFLAGS = $(cppflags_qt5)
t_changeexpiryjob5_SOURCES = t-changeexpiryjob.cpp $(support_src)
t_changeexpiryjob5_LDADD = $(ldadd_qt5)
t_changeexpiryjob5_CPPFLAGS = $(cppflags_qt5)
t_config5_SOURCES = t-config.cpp $(support_src)
t_config5_LDADD = $(ldadd_qt5)
t_config5_CPPFLAGS = $(cppflags_qt5)
t_decryptverify5_SOURCES = t-decryptverify.cpp $(support_src)
t_decryptverify5_LDADD = $(ldadd_qt5)
t_decryptverify5_CPPFLAGS = $(cppflags_qt5)
t_disablekey5_SOURCES = t-disablekey.cpp $(support_src)
t_disablekey5_LDADD = $(ldadd_qt5)
t_disablekey5_CPPFLAGS = $(cppflags_qt5)
t_encrypt5_SOURCES = t-encrypt.cpp $(support_src)
t_encrypt5_LDADD = $(ldadd_qt5)
t_encrypt5_CPPFLAGS = $(cppflags_qt5)
t_import5_SOURCES = t-import.cpp $(support_src)
t_import5_LDADD = $(ldadd_qt5)
t_import5_CPPFLAGS = $(cppflags_qt5)
t_keylist5_SOURCES = t-keylist.cpp $(support_src)
t_keylist5_LDADD = $(ldadd_qt5)
t_keylist5_CPPFLAGS = $(cppflags_qt5)
t_keylocate5_SOURCES = t-keylocate.cpp $(support_src)
t_keylocate5_LDADD = $(ldadd_qt5)
t_keylocate5_CPPFLAGS = $(cppflags_qt5)
t_ownertrust5_SOURCES = t-ownertrust.cpp $(support_src)
t_ownertrust5_LDADD = $(ldadd_qt5)
t_ownertrust5_CPPFLAGS = $(cppflags_qt5)
t_remarks5_SOURCES = t-remarks.cpp $(support_src)
t_remarks5_LDADD = $(ldadd_qt5)
t_remarks5_CPPFLAGS = $(cppflags_qt5)
t_revokekey5_SOURCES = t-revokekey.cpp $(support_src)
t_revokekey5_LDADD = $(ldadd_qt5)
t_revokekey5_CPPFLAGS = $(cppflags_qt5)
t_setprimaryuserid5_SOURCES = t-setprimaryuserid.cpp $(support_src)
t_setprimaryuserid5_LDADD = $(ldadd_qt5)
t_setprimaryuserid5_CPPFLAGS = $(cppflags_qt5)
t_tofuinfo5_SOURCES = t-tofuinfo.cpp $(support_src)
t_tofuinfo5_LDADD = $(ldadd_qt5)
t_tofuinfo5_CPPFLAGS = $(cppflags_qt5)
t_trustsignatures5_SOURCES = t-trustsignatures.cpp $(support_src)
t_trustsignatures5_LDADD = $(ldadd_qt5)
t_trustsignatures5_CPPFLAGS = $(cppflags_qt5)
t_various5_SOURCES = t-various.cpp $(support_src)
t_various5_LDADD = $(ldadd_qt5)
t_various5_CPPFLAGS = $(cppflags_qt5)
t_verify5_SOURCES = t-verify.cpp $(support_src)
t_verify5_LDADD = $(ldadd_qt5)
t_verify5_CPPFLAGS = $(cppflags_qt5)
t_wkdlookup5_SOURCES = t-wkdlookup.cpp $(support_src)
t_wkdlookup5_LDADD = $(ldadd_qt5)
t_wkdlookup5_CPPFLAGS = $(cppflags_qt5)
# t_wkspublish5_SOURCES = t-wkspublish.cpp $(support_src)
# t_wkspublish5_LDADD = $(ldadd_qt5)
# t_wkspublish5_CPPFLAGS = $(cppflags_qt5)
run_decryptverifyarchivejob5_SOURCES = run-decryptverifyarchivejob.cpp
run_decryptverifyarchivejob5_LDADD = $(ldadd_qt5)
run_decryptverifyarchivejob5_CPPFLAGS = $(cppflags_qt5)
run_decryptverifyjob5_SOURCES = run-decryptverifyjob.cpp
run_decryptverifyjob5_LDADD = $(ldadd_qt5)
run_decryptverifyjob5_CPPFLAGS = $(cppflags_qt5)
run_encryptarchivejob5_SOURCES = run-encryptarchivejob.cpp
run_encryptarchivejob5_LDADD = $(ldadd_qt5)
run_encryptarchivejob5_CPPFLAGS = $(cppflags_qt5)
run_encryptjob5_SOURCES = run-encryptjob.cpp
run_encryptjob5_LDADD = $(ldadd_qt5)
run_encryptjob5_CPPFLAGS = $(cppflags_qt5)
run_exportjob5_SOURCES = run-exportjob.cpp
run_exportjob5_LDADD = $(ldadd_qt5)
run_exportjob5_CPPFLAGS = $(cppflags_qt5)
run_importjob5_SOURCES = run-importjob.cpp
run_importjob5_LDADD = $(ldadd_qt5)
run_importjob5_CPPFLAGS = $(cppflags_qt5)
run_keyformailboxjob5_SOURCES = run-keyformailboxjob.cpp
run_keyformailboxjob5_LDADD = $(ldadd_qt5)
run_keyformailboxjob5_CPPFLAGS = $(cppflags_qt5)
run_receivekeysjob5_SOURCES = run-receivekeysjob.cpp
run_receivekeysjob5_LDADD = $(ldadd_qt5)
run_receivekeysjob5_CPPFLAGS = $(cppflags_qt5)
run_refreshkeysjob5_SOURCES = run-refreshkeysjob.cpp
run_refreshkeysjob5_LDADD = $(ldadd_qt5)
run_refreshkeysjob5_CPPFLAGS = $(cppflags_qt5)
run_signarchivejob5_SOURCES = run-signarchivejob.cpp
run_signarchivejob5_LDADD = $(ldadd_qt5)
run_signarchivejob5_CPPFLAGS = $(cppflags_qt5)
run_signjob5_SOURCES = run-signjob.cpp
run_signjob5_LDADD = $(ldadd_qt5)
run_signjob5_CPPFLAGS = $(cppflags_qt5)
run_verifydetachedjob5_SOURCES = run-verifydetachedjob.cpp
run_verifydetachedjob5_LDADD = $(ldadd_qt5)
run_verifydetachedjob5_CPPFLAGS = $(cppflags_qt5)
run_verifyopaquejob5_SOURCES = run-verifyopaquejob.cpp
run_verifyopaquejob5_LDADD = $(ldadd_qt5)
run_verifyopaquejob5_CPPFLAGS = $(cppflags_qt5)
run_wkdrefreshjob5_SOURCES = run-wkdrefreshjob.cpp
run_wkdrefreshjob5_LDADD = $(ldadd_qt5)
run_wkdrefreshjob5_CPPFLAGS = $(cppflags_qt5)

#nodist_t_keylist5_SOURCES = $(moc5_files) $(moc5_forward_headers)
endif
if WANT_QT6
t_addexistingsubkey6_SOURCES = t-addexistingsubkey.cpp $(support_src)
t_addexistingsubkey6_LDADD = $(ldadd_qt6)
t_addexistingsubkey6_CPPFLAGS = $(cppflags_qt6)
t_changeexpiryjob6_SOURCES = t-changeexpiryjob.cpp $(support_src)
t_changeexpiryjob6_LDADD = $(ldadd_qt6)
t_changeexpiryjob6_CPPFLAGS = $(cppflags_qt6)
t_config6_SOURCES = t-config.cpp $(support_src)
t_config6_LDADD = $(ldadd_qt6)
t_config6_CPPFLAGS = $(cppflags_qt6)
t_decryptverify6_SOURCES = t-decryptverify.cpp $(support_src)
t_decryptverify6_LDADD = $(ldadd_qt6)
t_decryptverify6_CPPFLAGS = $(cppflags_qt6)
t_disablekey6_SOURCES = t-disablekey.cpp $(support_src)
t_disablekey6_LDADD = $(ldadd_qt6)
t_disablekey6_CPPFLAGS = $(cppflags_qt6)
t_encrypt6_SOURCES = t-encrypt.cpp $(support_src)
t_encrypt6_LDADD = $(ldadd_qt6)
t_encrypt6_CPPFLAGS = $(cppflags_qt6)
t_import6_SOURCES = t-import.cpp $(support_src)
t_import6_LDADD = $(ldadd_qt6)
t_import6_CPPFLAGS = $(cppflags_qt6)
t_keylist6_SOURCES = t-keylist.cpp $(support_src)
t_keylist6_LDADD = $(ldadd_qt6)
t_keylist6_CPPFLAGS = $(cppflags_qt6)
t_keylocate6_SOURCES = t-keylocate.cpp $(support_src)
t_keylocate6_LDADD = $(ldadd_qt6)
t_keylocate6_CPPFLAGS = $(cppflags_qt6)
t_ownertrust6_SOURCES = t-ownertrust.cpp $(support_src)
t_ownertrust6_LDADD = $(ldadd_qt6)
t_ownertrust6_CPPFLAGS = $(cppflags_qt6)
t_remarks6_SOURCES = t-remarks.cpp $(support_src)
t_remarks6_LDADD = $(ldadd_qt6)
t_remarks6_CPPFLAGS = $(cppflags_qt6)
t_revokekey6_SOURCES = t-revokekey.cpp $(support_src)
t_revokekey6_LDADD = $(ldadd_qt6)
t_revokekey6_CPPFLAGS = $(cppflags_qt6)
t_setprimaryuserid6_SOURCES = t-setprimaryuserid.cpp $(support_src)
t_setprimaryuserid6_LDADD = $(ldadd_qt6)
t_setprimaryuserid6_CPPFLAGS = $(cppflags_qt6)
t_tofuinfo6_SOURCES = t-tofuinfo.cpp $(support_src)
t_tofuinfo6_LDADD = $(ldadd_qt6)
t_tofuinfo6_CPPFLAGS = $(cppflags_qt6)
t_trustsignatures6_SOURCES = t-trustsignatures.cpp $(support_src)
t_trustsignatures6_LDADD = $(ldadd_qt6)
t_trustsignatures6_CPPFLAGS = $(cppflags_qt6)
t_various6_SOURCES = t-various.cpp $(support_src)
t_various6_LDADD = $(ldadd_qt6)
t_various6_CPPFLAGS = $(cppflags_qt6)
t_verify6_SOURCES = t-verify.cpp $(support_src)
t_verify6_LDADD = $(ldadd_qt6)
t_verify6_CPPFLAGS = $(cppflags_qt6)
t_wkdlookup6_SOURCES = t-wkdlookup.cpp $(support_src)
t_wkdlookup6_LDADD = $(ldadd_qt6)
t_wkdlookup6_CPPFLAGS = $(cppflags_qt6)
# t_wkspublish6_SOURCES = t-wkspublish.cpp $(support_src)
# t_wkspublish6_LDADD = $(ldadd_qt6)
# t_wkspublish6_CPPFLAGS = $(cppflags_qt6)
run_decryptverifyarchivejob6_SOURCES = run-decryptverifyarchivejob.cpp
run_decryptverifyarchivejob6_LDADD = $(ldadd_qt6)
run_decryptverifyarchivejob6_CPPFLAGS = $(cppflags_qt6)
run_decryptverifyjob6_SOURCES = run-decryptverifyjob.cpp
run_decryptverifyjob6_LDADD = $(ldadd_qt6)
run_decryptverifyjob6_CPPFLAGS = $(cppflags_qt6)
run_encryptarchivejob6_SOURCES = run-encryptarchivejob.cpp
run_encryptarchivejob6_LDADD = $(ldadd_qt6)
run_encryptarchivejob6_CPPFLAGS = $(cppflags_qt6)
run_encryptjob6_SOURCES = run-encryptjob.cpp
run_encryptjob6_LDADD = $(ldadd_qt6)
run_encryptjob6_CPPFLAGS = $(cppflags_qt6)
run_exportjob6_SOURCES = run-exportjob.cpp
run_exportjob6_LDADD = $(ldadd_qt6)
run_exportjob6_CPPFLAGS = $(cppflags_qt6)
run_importjob6_SOURCES = run-importjob.cpp
run_importjob6_LDADD = $(ldadd_qt6)
run_importjob6_CPPFLAGS = $(cppflags_qt6)
run_keyformailboxjob6_SOURCES = run-keyformailboxjob.cpp
run_keyformailboxjob6_LDADD = $(ldadd_qt6)
run_keyformailboxjob6_CPPFLAGS = $(cppflags_qt6)
run_receivekeysjob6_SOURCES = run-receivekeysjob.cpp
run_receivekeysjob6_LDADD = $(ldadd_qt6)
run_receivekeysjob6_CPPFLAGS = $(cppflags_qt6)
run_refreshkeysjob6_SOURCES = run-refreshkeysjob.cpp
run_refreshkeysjob6_LDADD = $(ldadd_qt6)
run_refreshkeysjob6_CPPFLAGS = $(cppflags_qt6)
run_signarchivejob6_SOURCES = run-signarchivejob.cpp
run_signarchivejob6_LDADD = $(ldadd_qt6)
run_signarchivejob6_CPPFLAGS = $(cppflags_qt6)
run_signjob6_SOURCES = run-signjob.cpp
run_signjob6_LDADD = $(ldadd_qt6)
run_signjob6_CPPFLAGS = $(cppflags_qt6)
run_verifydetachedjob6_SOURCES = run-verifydetachedjob.cpp
run_verifydetachedjob6_LDADD = $(ldadd_qt6)
run_verifydetachedjob6_CPPFLAGS = $(cppflags_qt6)
run_verifyopaquejob6_SOURCES = run-verifyopaquejob.cpp
run_verifyopaquejob6_LDADD = $(ldadd_qt6)
run_verifyopaquejob6_CPPFLAGS = $(cppflags_qt6)
run_wkdrefreshjob6_SOURCES = run-wkdrefreshjob.cpp
run_wkdrefreshjob6_LDADD = $(ldadd_qt6)
run_wkdrefreshjob6_CPPFLAGS = $(cppflags_qt6)

# nodist_t_keylist6_SOURCES = $(moc6_files) $(moc6_forward_headers)
endif

BUILT_SOURCES = $(moc5_files) $(moc5_forward_headers) \
		$(moc6_files) $(moc6_forward_headers) \
		pubring-stamp

noinst_PROGRAMS = $(the_tests5) $(the_runners5) $(the_tests6) $(the_runners6)

CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
	gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
	random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp \
	$(moc5_files) $(moc5_forward_headers) \
	$(moc6_files) $(moc6_forward_headers) \
	gpg.conf tofu.db reader_0.status reader_1.status

clean-local:
	-test -z "$(moc5_dir)" || rm -rf $(moc5_dir)
	-test -z "$(moc6_dir)" || rm -rf $(moc6_dir)
	-$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop
	-rm -fR  private-keys-v1.d crls.d

clean-keyring:
	-$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop
	-rm -fR private-keys-v1.d crls.d pubring.gpg pubring.kbx secring.gpg \
		trustdb.gpg pubring-stamp

pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
	             $(top_srcdir)/tests/gpg/secdemo.asc
	-$(TESTS_ENVIRONMENT) gpgconf --kill all
	echo "ignore-invalid-option allow-loopback-pinentry" > $(abs_builddir)/gpg-agent.conf
	echo "allow-loopback-pinentry" >> gpg-agent.conf
	echo "ignore-invalid-option pinentry-mode" > gpg.conf
	echo "pinentry-mode loopback" >> gpg.conf
	$(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \
           --import $(top_srcdir)/tests/gpg/pubdemo.asc
	$(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \
		   --passphrase "abc" \
           --import $(top_srcdir)/tests/gpg/secdemo.asc
	-$(TESTS_ENVIRONMENT) gpgconf --kill all
	touch pubring-stamp