2013-05-01 15: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.
2016-03-02 10:28:04 -05:00
include $(top_srcdir)/buildutil/glib-tap.mk
2016-06-12 10:43:34 +01:00
EXTRA_DIST += \
buildutil/tap-driver.sh \
buildutil/tap-test \
$(NULL)
2016-03-02 10:28:04 -05:00
# We should probably consider flipping the default for DEBUG. Also,
# include the builddir in $PATH so we find our just-built ostree
# binary.
TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \
2016-03-31 09:02:23 +01:00
GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd) \
LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd) \
2016-05-11 15:54:48 -04:00
PATH=$$(cd $(top_builddir)/tests && pwd):$${PATH} \
2016-03-31 09:02:23 +01:00
$(NULL)
2016-03-02 10:28:04 -05:00
2016-07-14 13:42:32 +02:00
uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-symlink-stamp \
tests/ostree-remount-symlink-stamp tests/rofiles-fuse-symlink-stamp
2016-05-11 15:54:48 -04:00
2016-06-12 10:39:46 +01:00
dist_uninstalled_test_scripts = tests/test-symbols.sh
2016-03-23 15:18:27 -04:00
2016-06-12 10:39:46 +01:00
dist_test_scripts = \
2016-03-02 10:28:04 -05:00
tests/test-basic.sh \
tests/test-pull-subpath.sh \
tests/test-archivez.sh \
tests/test-remote-add.sh \
tests/test-remote-gpg-import.sh \
tests/test-commit-sign.sh \
tests/test-export.sh \
tests/test-help.sh \
tests/test-libarchive.sh \
2016-04-01 10:20:34 +02:00
tests/test-parent.sh \
2016-03-02 10:28:04 -05:00
tests/test-pull-archive-z.sh \
tests/test-pull-commit-only.sh \
tests/test-pull-corruption.sh \
tests/test-pull-depth.sh \
tests/test-pull-mirror-summary.sh \
tests/test-pull-large-metadata.sh \
tests/test-pull-metalink.sh \
tests/test-pull-summary-sigs.sh \
tests/test-pull-resume.sh \
2016-07-07 17:39:07 -04:00
tests/test-pull-repeated.sh \
2016-03-23 12:32:03 +01:00
tests/test-pull-untrusted.sh \
2016-04-22 14:41:04 +02:00
tests/test-pull-override-url.sh \
2016-04-04 14:43:33 +02:00
tests/test-local-pull.sh \
2016-03-02 10:28:04 -05:00
tests/test-local-pull-depth.sh \
tests/test-gpg-signed-commit.sh \
tests/test-admin-upgrade-unconfigured.sh \
tests/test-admin-deploy-syslinux.sh \
tests/test-admin-deploy-2.sh \
tests/test-admin-deploy-karg.sh \
tests/test-admin-deploy-switch.sh \
tests/test-admin-deploy-etcmerge-cornercases.sh \
tests/test-admin-deploy-uboot.sh \
2016-04-01 13:51:18 +02:00
tests/test-admin-deploy-grub2.sh \
2016-01-13 11:33:54 -05:00
tests/test-admin-deploy-bootid-gc.sh \
2016-03-02 10:28:04 -05:00
tests/test-admin-instutil-set-kargs.sh \
tests/test-admin-upgrade-not-backwards.sh \
tests/test-admin-pull-deploy-commit.sh \
tests/test-admin-locking.sh \
tests/test-admin-deploy-clean.sh \
tests/test-repo-checkout-subpath.sh \
tests/test-reset-nonlinear.sh \
tests/test-oldstyle-partial.sh \
tests/test-delta.sh \
tests/test-xattrs.sh \
tests/test-auto-summary.sh \
tests/test-prune.sh \
tests/test-refs.sh \
2016-03-03 21:17:53 -05:00
tests/test-demo-buildsystem.sh \
2013-05-01 15:26:21 -04:00
$(NULL)
2016-02-10 12:42:54 +01:00
if BUILDOPT_FUSE
2016-06-12 10:39:46 +01:00
dist_test_scripts += tests/test-rofiles-fuse.sh
2016-02-10 12:42:54 +01:00
endif
2014-01-21 19:53:06 +00:00
# This one uses corrupt-repo-ref.js
if BUILDOPT_GJS
2016-06-12 10:39:46 +01:00
dist_test_scripts += tests/test-corruption.sh
2014-01-21 19:53:06 +00:00
endif
2016-06-12 10:39:46 +01:00
dist_installed_test_data = tests/archive-test.sh \
2013-05-01 15:26:21 -04:00
tests/pull-test.sh \
tests/libtest.sh \
2014-01-15 09:48:04 -05:00
tests/admin-test.sh \
2014-12-05 14:28:16 +01:00
tests/basic-test.sh \
2014-12-05 14:40:15 +01:00
tests/test-basic-user.sh \
2014-01-19 12:39:38 -05:00
tests/corrupt-repo-ref.js \
2016-02-24 17:04:04 -05:00
tests/pre-endian-deltas-repo-big.tar.xz \
tests/pre-endian-deltas-repo-little.tar.xz \
2013-05-01 15:26:21 -04:00
$(NULL)
2016-06-12 10:39:46 +01:00
dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \
2016-04-01 13:51:18 +02:00
tests/ostree-grub-generator
2015-05-27 20:08:44 -04:00
2016-03-08 13:12:00 -05:00
# We can't use nobase_ as we need to strip off the tests/, can't
# use plain installed_ as we do need the gpghome/ prefix.
if ENABLE_INSTALLED_TESTS
2016-03-02 10:28:04 -05:00
gpginsttestdir = $(installed_testdir)/gpghome
2016-06-12 10:45:48 +01:00
dist_gpginsttest_DATA = tests/gpghome/secring.gpg \
2016-03-02 10:28:04 -05:00
tests/gpghome/pubring.gpg \
2015-05-07 13:42:19 -04:00
tests/gpghome/trustdb.gpg \
tests/gpghome/key1.asc \
tests/gpghome/key2.asc \
tests/gpghome/key3.asc
2016-03-02 10:28:04 -05:00
gpginsttest_trusteddir = $(installed_testdir)/gpghome/trusted
2016-06-12 10:45:48 +01:00
dist_gpginsttest_trusted_DATA = tests/gpghome/trusted/pubring.gpg
2014-02-10 09:38:07 -05:00
2016-03-02 10:28:04 -05:00
gpgvinsttestdir = $(installed_testdir)/gpg-verify-data
2016-06-12 10:45:48 +01:00
dist_gpgvinsttest_DATA = $(addprefix tests/gpg-verify-data/, \
2016-03-02 10:28:04 -05:00
gpg.conf lgpl2 lgpl2.sig pubring.gpg secring.gpg trustdb.gpg)
2016-03-08 13:12:00 -05:00
endif
2015-02-16 10:29:14 -05:00
2013-09-18 12:01:46 -04:00
if BUILDOPT_GJS
2016-06-12 10:39:46 +01:00
dist_installed_test_scripts = tests/test-core.js \
2013-10-08 20:44:39 -06:00
tests/test-sizes.js \
2014-03-19 09:15:29 -04:00
tests/test-sysroot.js \
2013-10-02 19:47:38 -04:00
$(NULL)
2013-09-18 12:01:46 -04:00
endif
2016-03-02 10:28:04 -05:00
test_ltlibraries = libreaddir-rand.la
2015-06-01 22:34:14 -04:00
libreaddir_rand_la_SOURCES = tests/readdir-rand.c
2016-06-17 09:36:51 -04:00
libreaddir_rand_la_CFLAGS = $(AM_CFLAGS) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
2016-06-12 10:25:21 -04:00
libreaddir_rand_la_LIBADD = \
-ldl \
$(OT_INTERNAL_GIO_UNIX_LIBS) \
$(NULL)
2016-06-17 09:36:51 -04:00
libreaddir_rand_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
2016-03-31 10:17:02 +01:00
if !ENABLE_INSTALLED_TESTS
libreaddir_rand_la_LDFLAGS += -rpath $(abs_builddir)
endif
2015-06-01 22:34:14 -04:00
2016-03-02 10:28:04 -05:00
test_programs = tests/test-varint tests/test-ot-unix-utils tests/test-bsdiff tests/test-mutable-tree \
2015-03-04 12:44:47 -05:00
tests/test-keyfile-utils tests/test-ot-opt-utils tests/test-ot-tool-util \
2016-03-02 10:05:08 -05:00
tests/test-gpg-verify-result tests/test-checksum tests/test-lzma tests/test-rollsum \
2016-06-06 14:49:11 -04:00
tests/test-basic-c tests/test-sysroot-c tests/test-pull-c
2015-03-06 11:38:13 +01:00
2016-03-02 10:28:04 -05:00
# An interactive tool
noinst_PROGRAMS += tests/test-rollsum-cli
2016-02-18 16:49:30 -05:00
if USE_LIBARCHIVE
2016-03-02 10:28:04 -05:00
test_programs += tests/test-libarchive-import
2016-02-18 16:49:30 -05:00
endif
2016-03-02 10:05:08 -05:00
common_tests_cflags = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx
common_tests_ldadd = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
noinst_LTLIBRARIES += libostreetest.la
libostreetest_la_SOURCES = tests/libostreetest.c
libostreetest_la_CFLAGS = $(common_tests_cflags) -I $(srcdir)/tests
libostreetest_la_LIBADD = $(common_tests_ldadd)
TESTS_CFLAGS = $(common_tests_cflags)
TESTS_LDADD = $(common_tests_ldadd) libostreetest.la
2015-02-02 12:56:40 +01:00
2015-08-14 08:43:44 +02:00
tests_test_rollsum_cli_SOURCES = src/libostree/ostree-rollsum.c tests/test-rollsum-cli.c
tests_test_rollsum_cli_CFLAGS = $(TESTS_CFLAGS) $(OT_DEP_ZLIB_CFLAGS)
tests_test_rollsum_cli_LDADD = libbupsplit.la $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
2015-02-02 12:56:40 +01:00
2015-08-25 09:27:56 -04:00
tests_test_rollsum_SOURCES = src/libostree/ostree-rollsum.c tests/test-rollsum.c
tests_test_rollsum_CFLAGS = $(TESTS_CFLAGS) $(OT_DEP_ZLIB_CFLAGS)
tests_test_rollsum_LDADD = libbupsplit.la $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
2015-03-04 14:14:18 +01:00
tests_test_mutable_tree_CFLAGS = $(TESTS_CFLAGS)
tests_test_mutable_tree_LDADD = $(TESTS_LDADD)
2016-03-02 10:05:08 -05:00
tests_test_basic_c_CFLAGS = $(TESTS_CFLAGS)
tests_test_basic_c_LDADD = $(TESTS_LDADD)
2016-03-03 13:49:54 -05:00
tests_test_sysroot_c_CFLAGS = $(TESTS_CFLAGS)
tests_test_sysroot_c_LDADD = $(TESTS_LDADD)
2016-06-06 14:49:11 -04:00
tests_test_pull_c_CFLAGS = $(TESTS_CFLAGS)
tests_test_pull_c_LDADD = $(TESTS_LDADD)
2015-03-03 14:21:40 +01:00
tests_test_ot_unix_utils_CFLAGS = $(TESTS_CFLAGS)
tests_test_ot_unix_utils_LDADD = $(TESTS_LDADD)
2015-02-02 12:56:40 +01:00
2015-03-03 14:21:40 +01: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 10:05:19 +01:00
2015-03-03 14:21:40 +01:00
tests_test_bsdiff_CFLAGS = $(TESTS_CFLAGS)
tests_test_bsdiff_LDADD = libbsdiff.la $(TESTS_LDADD)
2015-03-05 15:40:52 +01:00
2015-04-28 17:45:37 +02: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)
2016-02-18 16:49:30 -05:00
tests_test_libarchive_import_SOURCES = tests/test-libarchive-import.c
2016-03-11 08:46:27 +00:00
tests_test_libarchive_import_CFLAGS = $(TESTS_CFLAGS) $(libglnx_cflags) $(OT_DEP_LIBARCHIVE_CFLAGS)
tests_test_libarchive_import_LDADD = $(TESTS_LDADD) $(OT_DEP_LIBARCHIVE_LIBS)
2016-02-18 16:49:30 -05:00
2015-03-05 15:40:52 +01:00
tests_test_keyfile_utils_CFLAGS = $(TESTS_CFLAGS)
tests_test_keyfile_utils_LDADD = $(TESTS_LDADD)
2015-03-06 11:38:13 +01:00
tests_test_ot_opt_utils_CFLAGS = $(TESTS_CFLAGS)
tests_test_ot_opt_utils_LDADD = $(TESTS_LDADD)
2015-03-06 12:54:53 +01:00
tests_test_ot_tool_util_CFLAGS = $(TESTS_CFLAGS)
tests_test_ot_tool_util_LDADD = $(TESTS_LDADD)
2015-03-04 12:44:47 -05:00
2015-08-11 11:26:14 +02:00
tests_test_lzma_SOURCES = src/libostree/ostree-lzma-common.c src/libostree/ostree-lzma-compressor.c \
src/libostree/ostree-lzma-decompressor.c tests/test-lzma.c
2015-08-26 09:54:31 -07:00
tests_test_lzma_CFLAGS = $(TESTS_CFLAGS) $(OT_DEP_LZMA_CFLAGS)
tests_test_lzma_LDADD = $(TESTS_LDADD) $(OT_DEP_LZMA_LIBS)
2015-08-11 11:26:14 +02:00
2015-03-04 12:44:47 -05:00
tests_test_gpg_verify_result_SOURCES = \
src/libostree/ostree-gpg-verify-result-private.h \
tests/test-gpg-verify-result.c
2015-05-12 15:48:22 -07: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 12:44:47 -05:00
EXTRA_DIST += \
2016-04-07 09:53:54 +02:00
tests/libostreetest.h \
2016-06-12 10:45:48 +01:00
tests/libtest.sh \
2015-03-04 12:44:47 -05:00
tests/gpg-verify-data/README.md \
2016-05-13 06:47:09 -07:00
$(NULL)
2016-03-02 10:28:04 -05:00
2016-04-06 21:26:38 -04:00
tests/libreaddir-rand.so: Makefile
$(AM_V_GEN) ln -fns ../.libs/libreaddir-rand.so tests
ALL_LOCAL_RULES += tests/libreaddir-rand.so
2016-07-14 13:42:32 +02:00
CLEANFILES += tests/libreaddir-rand.so tests/ostree-symlink-stamp \
tests/ostree-prepare-root-symlink-stamp tests/ostree-remount-symlink-stamp \
tests/rofiles-fuse-symlink-stamp tests/ostree
2016-05-11 15:54:48 -04:00
2016-07-15 11:17:43 -04:00
tests/%-symlink-stamp: % Makefile
$(AM_V_GEN) set -e; \
2016-07-14 13:42:32 +02:00
lt_bin=`cd $(top_builddir) && ./libtool --mode=execute echo $*`; \
if test "$${lt_bin}" = "$*"; then \
real_bin=$(abs_top_builddir)/$*; \
else \
real_bin="$${lt_bin}"; \
fi; \
ln -sf "$${real_bin}" tests/$*; \
2016-05-11 15:54:48 -04:00
touch $@
2016-03-28 13:46:23 +01:00
2016-03-02 10:28:04 -05:00
# Unfortunately the glib test data APIs don't actually handle
# non-recursive Automake, so we change our code to canonically look
# for tests/ which is just a symlink when installed.
2016-03-08 13:12:00 -05:00
if ENABLE_INSTALLED_TESTS
2016-03-02 10:28:04 -05:00
install-test-data-file-path-hack:
if test -L $(DESTDIR)$(installed_testdir)/tests; then \
rm $(DESTDIR)$(installed_testdir)/tests; \
fi
ln -s . $(DESTDIR)$(installed_testdir)/tests
INSTALL_DATA_HOOKS += install-test-data-file-path-hack
2016-03-08 13:12:00 -05:00
endif