Qt: Add a unit test for qgpgme
[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 TESTS = t-keylist
26
27 moc_files = t-keylist.moc
28
29 AM_LDFLAGS = -no-install
30
31 LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \
32         ../../../src/libgpgme.la @GPGME_QT_LIBS@ @GPG_ERROR_LIBS@ \
33         @GPGME_QTTEST_LIBS@
34
35 AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ \
36               @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
37               @GPGME_QTTEST_CFLAGS@ \
38               -I$(top_srcdir)/lang/cpp/src -I$(top_srcdir)/lang/qt/src \
39               -DTOP_SRCDIR="$(top_srcdir)"
40
41 check-local: ./t-keylist ./pubring-stamp
42
43 t_keylist_SOURCES = t-keylist.cpp t-keylist.h
44
45 nodist_t_keylist_SOURCES = $(moc_files)
46
47 BUILT_SOURCES = $(moc_files)
48
49 noinst_PROGRAMS = t-keylist
50
51 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
52         gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
53         random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp $(moc_files)
54
55 export GNUPGHOME := $(abs_builddir)
56
57 ./pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
58                      $(top_srcdir)/tests/gpg/secdemo.asc
59         $(GPG) --no-permission-warning \
60            --import $(top_srcdir)/tests/gpg/pubdemo.asc
61         -$(GPG) --no-permission-warning \
62             --import $(top_srcdir)/tests/gpg/secdemo.asc
63         touch ./pubring-stamp
64
65 .cpp.moc:
66         $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@