Imported Upstream version 1.16.0
[platform/upstream/gpgme.git] / lang / qt / tests / Makefile.am
1 # Makefile.am - Makefile for GPGME Qt tests.
2 # Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
3 # Software engineering by Intevation GmbH
4 #
5 # This file is part of GPGME.
6 #
7 # GPGME is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 2.1 of the
10 # License, or (at your option) any later version.
11 #
12 # GPGME is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
15 # Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
19
20 ## Process this file with automake to produce Makefile.in
21
22 GPG = gpg
23
24 GNUPGHOME=$(abs_builddir)
25 TESTS_ENVIRONMENT = GNUPGHOME=$(GNUPGHOME)
26
27 EXTRA_DIST = initial.test
28
29 TESTS = initial.test t-keylist t-keylocate t-ownertrust t-tofuinfo \
30         t-encrypt t-verify t-various t-config t-remarks t-trustsignatures
31
32 moc_files = t-keylist.moc t-keylocate.moc t-ownertrust.moc t-tofuinfo.moc \
33             t-encrypt.moc t-support.hmoc t-wkspublish.moc t-verify.moc \
34             t-various.moc t-config.moc t-remarks.moc t-trustsignatures.moc
35
36 AM_LDFLAGS = -no-install
37
38 LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \
39         ../../../src/libgpgme.la @GPGME_QT_LIBS@ @GPG_ERROR_LIBS@ \
40         @GPGME_QTTEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++
41
42 AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
43               @GPG_ERROR_CFLAGS@ @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ \
44               @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ -DBUILDING_QGPGME \
45               -I$(top_srcdir)/lang/qt/src \
46               -DTOP_SRCDIR="$(top_srcdir)"
47
48 support_src = t-support.h t-support.cpp
49
50 t_keylist_SOURCES = t-keylist.cpp $(support_src)
51 t_keylocate_SOURCES = t-keylocate.cpp $(support_src)
52 t_ownertrust_SOURCES = t-ownertrust.cpp $(support_src)
53 t_tofuinfo_SOURCES = t-tofuinfo.cpp $(support_src)
54 t_encrypt_SOURCES = t-encrypt.cpp $(support_src)
55 t_wkspublish_SOURCES = t-wkspublish.cpp $(support_src)
56 t_verify_SOURCES = t-verify.cpp $(support_src)
57 t_various_SOURCES = t-various.cpp $(support_src)
58 t_config_SOURCES = t-config.cpp $(support_src)
59 t_remarks_SOURCES = t-remarks.cpp $(support_src)
60 t_trustsignatures_SOURCES = t-trustsignatures.cpp $(support_src)
61 run_keyformailboxjob_SOURCES = run-keyformailboxjob.cpp
62
63 nodist_t_keylist_SOURCES = $(moc_files)
64
65 BUILT_SOURCES = $(moc_files) pubring-stamp
66
67 noinst_PROGRAMS = t-keylist t-keylocate t-ownertrust t-tofuinfo t-encrypt \
68     run-keyformailboxjob t-wkspublish t-verify t-various t-config t-remarks \
69     t-trustsignatures
70
71 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
72         gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
73         random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp $(moc_files) \
74         gpg.conf tofu.db reader_0.status reader_1.status
75
76 clean-local:
77         -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop
78         -rm -fR  private-keys-v1.d crls.d
79
80 pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
81                      $(top_srcdir)/tests/gpg/secdemo.asc
82         -$(TESTS_ENVIRONMENT) gpgconf --kill all
83         echo "ignore-invalid-option allow-loopback-pinentry" > $(abs_builddir)/gpg-agent.conf
84         echo "allow-loopback-pinentry" >> gpg-agent.conf
85         echo "ignore-invalid-option pinentry-mode" > gpg.conf
86         echo "pinentry-mode loopback" >> gpg.conf
87         $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \
88            --import $(top_srcdir)/tests/gpg/pubdemo.asc
89         $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \
90                    --passphrase "abc" \
91            --import $(top_srcdir)/tests/gpg/secdemo.asc
92         touch pubring-stamp
93
94 .cpp.moc:
95         $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
96
97 .h.hmoc:
98         $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@