From 359ea9b58f789ad6a51e6f13e54d4034e6f30acd Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 8 Dec 2016 12:50:20 -0500 Subject: [PATCH] tests: Tweak installed tests to deal with ASAN We need to disable readdir-rand there too. Closes: #622 Approved by: jlebon --- Makefile-tests.am | 11 ++++++++++- tests/libtest.sh | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile-tests.am b/Makefile-tests.am index 11ac2d7f..8c37a6e6 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -116,7 +116,6 @@ endif dist_installed_test_data = tests/archive-test.sh \ tests/pull-test.sh \ - tests/libtest.sh \ tests/admin-test.sh \ tests/basic-test.sh \ tests/test-basic-user.sh \ @@ -125,6 +124,8 @@ dist_installed_test_data = tests/archive-test.sh \ tests/pre-endian-deltas-repo-little.tar.xz \ $(NULL) +EXTRA_DIST += tests/libtest.sh + dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \ tests/ostree-grub-generator @@ -286,4 +287,12 @@ install-test-data-file-path-hack: fi ln -s . $(DESTDIR)$(installed_testdir)/tests INSTALL_DATA_HOOKS += install-test-data-file-path-hack + +install-libtest: +if BUILDOPT_ASAN + sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh +else + install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh +endif +INSTALL_DATA_HOOKS += install-libtest endif diff --git a/tests/libtest.sh b/tests/libtest.sh index d16aae70..c0bf8d0d 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -86,13 +86,16 @@ if test -n "${OT_TESTS_DEBUG:-}"; then set -x fi +# This is substituted by the build for installed tests +BUILT_WITH_ASAN="" + if test -n "${OT_TESTS_VALGRIND:-}"; then CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --error-exitcode=1 --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp" else # In some cases the LD_PRELOAD may cause obscure problems, # e.g. right now it breaks for me with -fsanitize=address, so # let's allow users to skip it. - if test -z "${OT_SKIP_READDIR_RAND:-}"; then + if test -z "${OT_SKIP_READDIR_RAND:-}" && test -z "${BUILT_WITH_ASAN:-}"; then CMD_PREFIX="env LD_PRELOAD=${test_builddir}/libreaddir-rand.so" else CMD_PREFIX=""