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