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
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 \
2015-05-07 20:42:19 +03:00
test-remote-gpg-import \
2013-09-05 22:50:36 +04:00
test-commit-sign \
2014-09-25 11:05:45 +04:00
test-help \
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-10-27 05:46:57 +03:00
test-pull-depth \
2014-10-03 01:49:26 +04:00
test-pull-mirror-summary \
2014-04-25 23:14:42 +04:00
test-pull-large-metadata \
2014-08-01 02:50:19 +04:00
test-pull-metalink \
2015-06-02 01:40:44 +03:00
test-pull-summary-sigs \
2013-08-27 00:59:55 +04:00
test-pull-resume \
2015-06-08 20:11:11 +03:00
test-local-pull-depth \
2013-09-03 05:43:49 +04:00
test-gpg-signed-commit \
2014-10-01 02:12:08 +04:00
test-admin-upgrade-unconfigured \
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-09-26 19:43:46 +04:00
test-admin-instutil-set-kargs \
2014-02-21 03:25:56 +04:00
test-admin-upgrade-not-backwards \
2015-05-05 01:35:52 +03:00
test-admin-locking \
2015-01-30 17:14:42 +03:00
test-repo-checkout-subpath \
2015-04-08 03:54:37 +03:00
test-reset-nonlinear \
2015-04-06 21:19:08 +03:00
test-oldstyle-partial \
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 \
2015-04-02 13:33:07 +03:00
test-auto-summary \
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-12-05 16:28:16 +03:00
tests/basic-test.sh \
2014-12-05 16:40:15 +03:00
tests/test-basic-user.sh \
2014-12-08 14:00:59 +03:00
tests/test-local-pull.sh \
2014-01-19 21:39:38 +04:00
tests/corrupt-repo-ref.js \
2013-05-01 23:26:21 +04:00
$(NULL)
2015-05-28 03:08:44 +03:00
insttest_SCRIPTS += \
tests/syslinux-entries-crosscheck.py \
$(NULL)
2013-09-03 05:43:49 +04:00
gpginsttestdir = $(pkglibexecdir)/installed-tests/gpghome
gpginsttest_DATA = tests/gpghome/secring.gpg \
2015-05-07 20:42:19 +03:00
tests/gpghome/trustdb.gpg \
tests/gpghome/key1.asc \
tests/gpghome/key2.asc \
tests/gpghome/key3.asc
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 $@)
2015-02-16 18:29:14 +03:00
%.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 $@)
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
2015-06-02 05:34:14 +03:00
insttest_LTLIBRARIES = libreaddir-rand.la
libreaddir_rand_la_SOURCES = tests/readdir-rand.c
libreaddir_rand_la_CFLAGS = $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libreaddir_rand_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)
libreaddir_rand_la_LDFLAGS = -avoid-version
2013-05-01 23:26:21 +04:00
endif
2015-02-02 14:56:40 +03:00
# "make check" do not depend from --enable-installed-tests
2015-03-03 16:21:40 +03:00
noinst_PROGRAMS += tests/test-rollsum
2015-02-02 15:37:48 +03:00
2015-03-06 13:38:13 +03:00
TESTS = tests/test-varint tests/test-ot-unix-utils tests/test-bsdiff tests/test-mutable-tree \
2015-03-04 20:44:47 +03:00
tests/test-keyfile-utils tests/test-ot-opt-utils tests/test-ot-tool-util \
2015-04-28 18:45:37 +03:00
tests/test-gpg-verify-result tests/test-checksum
2015-03-06 13:38:13 +03:00
2015-03-03 16:21:40 +03:00
check_PROGRAMS = $(TESTS)
2015-03-04 20:44:47 +03:00
TESTS_ENVIRONMENT = \
G_TEST_SRCDIR=$(abs_srcdir)/tests \
G_TEST_BUILDDIR=$(abs_builddir)/tests
2015-04-27 04:25:35 +03:00
TESTS_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx
2015-03-03 16:21:40 +03:00
TESTS_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
2015-02-02 14:56:40 +03:00
2015-03-03 16:21:40 +03:00
tests_test_rollsum_SOURCES = src/libostree/ostree-rollsum.c tests/test-rollsum.c
2015-04-06 17:25:03 +03:00
tests_test_rollsum_CFLAGS = $(TESTS_CFLAGS) $(OT_DEP_ZLIB_CFLAGS)
tests_test_rollsum_LDADD = libbupsplit.la $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
2015-02-02 14:56:40 +03:00
2015-03-04 16:14:18 +03:00
tests_test_mutable_tree_CFLAGS = $(TESTS_CFLAGS)
tests_test_mutable_tree_LDADD = $(TESTS_LDADD)
2015-03-03 16:21:40 +03:00
tests_test_ot_unix_utils_CFLAGS = $(TESTS_CFLAGS)
tests_test_ot_unix_utils_LDADD = $(TESTS_LDADD)
2015-02-02 14:56:40 +03:00
2015-03-03 16:21:40 +03:00
tests_test_varint_SOURCES = src/libostree/ostree-varint.c tests/test-varint.c
tests_test_varint_CFLAGS = $(TESTS_CFLAGS)
tests_test_varint_LDADD = $(TESTS_LDADD)
2015-02-23 12:05:19 +03:00
2015-03-03 16:21:40 +03:00
tests_test_bsdiff_CFLAGS = $(TESTS_CFLAGS)
tests_test_bsdiff_LDADD = libbsdiff.la $(TESTS_LDADD)
2015-03-05 17:40:52 +03:00
2015-04-28 18:45:37 +03:00
tests_test_checksum_SOURCES = src/libostree/ostree-core.c tests/test-checksum.c
tests_test_checksum_CFLAGS = $(TESTS_CFLAGS) $(libglnx_cflags)
tests_test_checksum_LDADD = $(TESTS_LDADD)
2015-03-05 17:40:52 +03:00
tests_test_keyfile_utils_CFLAGS = $(TESTS_CFLAGS)
tests_test_keyfile_utils_LDADD = $(TESTS_LDADD)
2015-03-06 13:38:13 +03:00
tests_test_ot_opt_utils_CFLAGS = $(TESTS_CFLAGS)
tests_test_ot_opt_utils_LDADD = $(TESTS_LDADD)
2015-03-06 14:54:53 +03:00
tests_test_ot_tool_util_CFLAGS = $(TESTS_CFLAGS)
tests_test_ot_tool_util_LDADD = $(TESTS_LDADD)
2015-03-04 20:44:47 +03:00
tests_test_gpg_verify_result_SOURCES = \
src/libostree/ostree-gpg-verify-result-private.h \
tests/test-gpg-verify-result.c
2015-05-13 01:48:22 +03:00
tests_test_gpg_verify_result_CFLAGS = $(TESTS_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS)
tests_test_gpg_verify_result_LDADD = $(TESTS_LDADD) $(OT_INTERNAL_GPGME_LIBS)
2015-03-04 20:44:47 +03:00
EXTRA_DIST += \
tests/gpg-verify-data/README.md \
tests/gpg-verify-data/lgpl2 \
tests/gpg-verify-data/lgpl2.sig \
tests/gpg-verify-data/pubring.gpg \
tests/gpg-verify-data/secring.gpg \
tests/gpg-verify-data/trustdb.gpg \
tests/gpg-verify-data/gpg.conf