2013-05-01 23:26:21 +04:00
# 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
2013-08-15 17:03:21 +04:00
insttest_PROGRAMS =
2013-05-01 23:26:21 +04:00
insttestdir=$(pkglibexecdir)/installed-tests
2013-07-09 18:41:07 +04:00
testfiles = test-basic \
2014-08-05 16:41:50 +04:00
test-pull-subpath \
2013-07-09 18:41:07 +04:00
test-archivez \
test-remote-add \
2013-09-05 22:50:36 +04:00
test-commit-sign \
2013-07-09 18:41:07 +04:00
test-libarchive \
test-pull-archive-z \
2013-07-09 19:28:49 +04:00
test-pull-corruption \
2014-04-25 23:14:42 +04:00
test-pull-large-metadata \
2014-08-01 02:50:19 +04:00
test-pull-metalink \
2013-08-27 00:59:55 +04:00
test-pull-resume \
2013-09-03 05:43:49 +04:00
test-gpg-signed-commit \
2014-01-15 18:48:04 +04:00
test-admin-deploy-syslinux \
2013-07-09 18:41:07 +04:00
test-admin-deploy-2 \
2014-01-15 17:46:05 +04:00
test-admin-deploy-karg \
2014-01-19 02:42:24 +04:00
test-admin-deploy-switch \
2013-11-19 04:47:46 +04:00
test-admin-deploy-etcmerge-cornercases \
2013-09-21 19:06:20 +04:00
test-admin-deploy-uboot \
2014-02-21 03:25:56 +04:00
test-admin-upgrade-not-backwards \
2013-07-18 22:23:55 +04:00
test-setuid \
2013-08-15 17:17:37 +04:00
test-delta \
2013-08-14 17:05:09 +04:00
test-xattrs \
2013-05-01 23:26:21 +04:00
$(NULL)
insttest_SCRIPTS = $(addprefix tests/,$(testfiles:=.sh))
2014-01-21 23:53:06 +04:00
# This one uses corrupt-repo-ref.js
if BUILDOPT_GJS
testfiles += test-corruption
endif
2013-08-15 17:03:21 +04:00
testmetadir = $(datadir)/installed-tests/$(PACKAGE)
testmeta_DATA = $(testfiles:=.test)
2013-05-01 23:26:21 +04:00
insttest_DATA = tests/archive-test.sh \
tests/pull-test.sh \
tests/libtest.sh \
2014-01-15 18:48:04 +04:00
tests/admin-test.sh \
2014-01-19 21:39:38 +04:00
tests/corrupt-repo-ref.js \
2013-05-01 23:26:21 +04:00
$(NULL)
2013-09-03 05:43:49 +04:00
gpginsttestdir = $(pkglibexecdir)/installed-tests/gpghome
gpginsttest_DATA = tests/gpghome/secring.gpg \
tests/gpghome/trustdb.gpg
2014-02-10 18:38:07 +04:00
gpginsttest_trusteddir = $(pkglibexecdir)/installed-tests/gpghome/trusted
gpginsttest_trusted_DATA = tests/gpghome/trusted/pubring.gpg
install-gpg-data-hook:
2014-02-13 19:57:05 +04:00
ln -sf trusted/pubring.gpg $(DESTDIR)$(gpginsttestdir)/pubring.gpg
2014-02-10 18:38:07 +04:00
INSTALL_DATA_HOOKS += install-gpg-data-hook
2013-09-03 05:43:49 +04:00
2013-05-01 23:26:21 +04:00
%.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 $@)
2013-09-18 20:01:46 +04:00
%.test: tests/%.js Makefile
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
2013-10-03 03:47:38 +04:00
echo 'Exec=env TESTDATADIR=$(pkglibexecdir)/installed-tests $(pkglibexecdir)/installed-tests/$(notdir $<)' >> $@.tmp; \
2013-09-18 20:01:46 +04:00
echo 'Type=session' >> $@.tmp; \
mv $@.tmp $@)
2013-08-15 17:03:21 +04:00
%.test: tests/%.c Makefile
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
echo 'Exec=$(pkglibexecdir)/installed-tests/$(notdir $(<:.c=))' >> $@.tmp; \
echo 'Type=session' >> $@.tmp; \
mv $@.tmp $@)
2013-10-16 00:30:09 +04:00
insttest_PROGRAMS += test-varint
2013-08-15 17:03:21 +04:00
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
2013-08-15 17:14:26 +04:00
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)
2013-09-18 20:01:46 +04:00
if BUILDOPT_GJS
2013-10-03 03:47:38 +04:00
insttest_SCRIPTS += tests/test-core.js \
2013-10-09 06:44:39 +04:00
tests/test-sizes.js \
2014-03-19 17:15:29 +04:00
tests/test-sysroot.js \
2013-10-03 03:47:38 +04:00
$(NULL)
2014-03-19 17:15:29 +04:00
testmeta_DATA += test-core.test test-sizes.test test-sysroot.test
2013-09-18 20:01:46 +04:00
endif
2013-05-01 23:26:21 +04:00
endif