Qt: Fix unit test by adding initial.test dep
[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
28
29 moc_files = t-keylist.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@
36
37 AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ \
38               @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
39               @GPGME_QTTEST_CFLAGS@ \
40               -I$(top_srcdir)/lang/cpp/src -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 t-keylist.h
50
51 nodist_t_keylist_SOURCES = $(moc_files)
52
53 BUILT_SOURCES = $(moc_files)
54
55 noinst_PROGRAMS = t-keylist
56
57 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
58         gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
59         random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp $(moc_files)
60
61 export GNUPGHOME := $(abs_builddir)
62
63 ./pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
64                      $(top_srcdir)/tests/gpg/secdemo.asc
65         $(GPG) --no-permission-warning \
66            --import $(top_srcdir)/tests/gpg/pubdemo.asc
67         $(GPG) --no-permission-warning \
68            --import $(top_srcdir)/tests/gpg/secdemo.asc
69         touch ./pubring-stamp
70
71 .cpp.moc:
72         $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@