summaryrefslogtreecommitdiff
path: root/Makefile-tests.am
blob: 5c8684101bf01bfafbdee621d1204f96ffeeb61e (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 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
insttest_PROGRAMS = 

insttestdir=$(pkglibexecdir)/installed-tests
testfiles = test-basic \
	test-archivez \
	test-remote-add \
        test-commit-sign \
	test-libarchive \
	test-pull-archive-z \
	test-pull-corruption \
	test-pull-large-metadata \
	test-pull-resume \
	test-gpg-signed-commit \
	test-admin-deploy-syslinux \
	test-admin-deploy-2 \
	test-admin-deploy-karg \
	test-admin-deploy-switch \
	test-admin-deploy-etcmerge-cornercases \
	test-admin-deploy-uboot \
	test-admin-upgrade-not-backwards \
	test-setuid \
	test-delta \
	test-xattrs \
	$(NULL)
insttest_SCRIPTS = $(addprefix tests/,$(testfiles:=.sh))

# This one uses corrupt-repo-ref.js
if BUILDOPT_GJS
testfiles += test-corruption
endif

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

insttest_DATA = tests/archive-test.sh \
	tests/pull-test.sh \
	tests/libtest.sh \
	tests/admin-test.sh \
	tests/corrupt-repo-ref.js \
	$(NULL)

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

install-gpg-data-hook:
	ln -sf trusted/pubring.gpg $(DESTDIR)$(gpginsttestdir)/pubring.gpg 
INSTALL_DATA_HOOKS += install-gpg-data-hook

%.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=env TESTDATADIR=$(pkglibexecdir)/installed-tests $(pkglibexecdir)/installed-tests/$(notdir $<)' >> $@.tmp; \
	 echo 'Type=session' >> $@.tmp; \
	 mv $@.tmp $@)

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

insttest_PROGRAMS += test-varint
test_varint_SOURCES = src/libostree/ostree-varint.c tests/test-varint.c
test_varint_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
test_varint_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
testmeta_DATA += test-varint.test

insttest_PROGRAMS += test-rollsum
test_rollsum_SOURCES = src/libostree/bupsplit.c tests/test-rollsum.c
test_rollsum_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
test_rollsum_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)

if BUILDOPT_GJS
insttest_SCRIPTS += tests/test-core.js \
	tests/test-sizes.js \
	tests/test-sysroot.js \
	$(NULL)
testmeta_DATA += test-core.test test-sizes.test test-sysroot.test
endif

endif