summaryrefslogtreecommitdiff
path: root/Makefile-tests.am
blob: d6b3e44842b08a6e76484982b2088f784b2d4931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Makefile for tests code
#
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.


if BUILDOPT_INSTALL_TESTS
insttestdir=$(pkglibexecdir)/installed-tests
testfiles = test-basic \
	test-archivez \
	test-remote-add \
	test-corruption \
	test-libarchive \
	test-pull-archive-z \
	test-pull-corruption \
	test-pull-resume \
	test-gpg-signed-commit \
	test-admin-deploy-1 \
	test-admin-deploy-2 \
	test-admin-deploy-uboot \
	test-setuid \
	test-xattrs \
	$(NULL)
insttest_SCRIPTS = $(addprefix tests/,$(testfiles:=.sh))

insttest_DATA = tests/archive-test.sh \
	tests/pull-test.sh \
	tests/libtest.sh \
	$(NULL)

gpginsttestdir = $(pkglibexecdir)/installed-tests/gpghome
gpginsttest_DATA = tests/gpghome/secring.gpg \
	tests/gpghome/pubring.gpg \
	tests/gpghome/trustdb.gpg

%.test: tests/%.sh Makefile
	$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
	 echo 'Exec=$(pkglibexecdir)/installed-tests/$(notdir $<)' >> $@.tmp; \
	 echo 'Type=session' >> $@.tmp; \
	 echo 'Output=TAP' >> $@.tmp; \
	 mv $@.tmp $@)

%.test: tests/%.js Makefile
	$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
	 echo 'Exec=$(pkglibexecdir)/installed-tests/$(notdir $<)' >> $@.tmp; \
	 echo 'Type=session' >> $@.tmp; \
	 mv $@.tmp $@)

testmetadir = $(datadir)/installed-tests/$(PACKAGE)
testmeta_DATA = $(testfiles:=.test)

if BUILDOPT_GJS
insttest_SCRIPTS += tests/test-core.js
testmeta_DATA += test-core.test
endif


endif