Imported Upstream version 1.11.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 <http://www.gnu.org/licenses/>.
19
20 ## Process this file with automake to produce Makefile.in
21
22 GPG = gpg
23
24 TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir)
25
26 EXTRA_DIST = initial.test
27
28 TESTS = initial.test t-keylist t-keylocate t-ownertrust t-tofuinfo \
29         t-encrypt t-verify t-various t-config
30
31 moc_files = t-keylist.moc t-keylocate.moc t-ownertrust.moc t-tofuinfo.moc \
32             t-encrypt.moc t-support.hmoc t-wkspublish.moc t-verify.moc \
33             t-various.moc t-config.moc
34
35 AM_LDFLAGS = -no-install
36
37 LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \
38         ../../../src/libgpgme.la @GPGME_QT_LIBS@ @GPG_ERROR_LIBS@ \
39         @GPGME_QTTEST_LIBS@ -lstdc++
40
41 AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
42               @GPG_ERROR_CFLAGS@ @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ \
43               @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ -DBUILDING_QGPGME \
44               -I$(top_srcdir)/lang/qt/src \
45               -DTOP_SRCDIR="$(top_srcdir)"
46
47 support_src = t-support.h t-support.cpp
48
49 t_keylist_SOURCES = t-keylist.cpp $(support_src)
50 t_keylocate_SOURCES = t-keylocate.cpp $(support_src)
51 t_ownertrust_SOURCES = t-ownertrust.cpp $(support_src)
52 t_tofuinfo_SOURCES = t-tofuinfo.cpp $(support_src)
53 t_encrypt_SOURCES = t-encrypt.cpp $(support_src)
54 t_wkspublish_SOURCES = t-wkspublish.cpp $(support_src)
55 t_verify_SOURCES = t-verify.cpp $(support_src)
56 t_various_SOURCES = t-various.cpp $(support_src)
57 t_config_SOURCES = t-config.cpp $(support_src)
58 run_keyformailboxjob_SOURCES = run-keyformailboxjob.cpp
59
60 nodist_t_keylist_SOURCES = $(moc_files)
61
62 BUILT_SOURCES = $(moc_files) pubring-stamp
63
64 noinst_PROGRAMS = t-keylist t-keylocate t-ownertrust t-tofuinfo t-encrypt \
65     run-keyformailboxjob t-wkspublish t-verify t-various t-config
66
67 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
68         gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
69         random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp $(moc_files) \
70         gpg.conf tofu.db
71
72 clean-local:
73         -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop
74         -rm -fR  private-keys-v1.d crls.d
75
76 pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
77                      $(top_srcdir)/tests/gpg/secdemo.asc
78         -$(TESTS_ENVIRONMENT) gpgconf --kill all
79         echo "ignore-invalid-option allow-loopback-pinentry" > $(abs_builddir)/gpg-agent.conf
80         echo "allow-loopback-pinentry" >> gpg-agent.conf
81         echo "ignore-invalid-option pinentry-mode" > gpg.conf
82         echo "pinentry-mode loopback" >> gpg.conf
83         $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \
84            --import $(top_srcdir)/tests/gpg/pubdemo.asc
85         $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \
86                    --passphrase "abc" \
87            --import $(top_srcdir)/tests/gpg/secdemo.asc
88         touch pubring-stamp
89
90 .cpp.moc:
91         $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
92
93 .h.hmoc:
94         $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@