Skip gjs-based tests if ASAN is enabled
Unfortunately, introspection uses dlopen(), which doesn't quite work when the DSO is compiled with ASAN but the outer executable isn't. Trying to inject LD_PRELOAD=libasan means the outer executable has to be leak free...which, yeah, I'm not going to get into running ASAN today on gjs or pygobject. So, let's skip those tests - ideally, we still run them in some other context without the sanitizers. The coverage we have from them is middling anyways. Closes: #622 Approved by: jlebon
This commit is contained in:
parent
17f264a487
commit
47b4dd1b38
|
|
@ -33,6 +33,9 @@ TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \
|
||||||
LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} \
|
LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} \
|
||||||
PATH=$$(cd $(top_builddir)/tests && pwd):$${PATH} \
|
PATH=$$(cd $(top_builddir)/tests && pwd):$${PATH} \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
if BUILDOPT_ASAN
|
||||||
|
TESTS_ENVIRONMENT += OT_SKIP_READDIR_RAND=1 G_SLICE=always-malloc
|
||||||
|
endif
|
||||||
|
|
||||||
uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-symlink-stamp \
|
uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-symlink-stamp \
|
||||||
tests/ostree-remount-symlink-stamp tests/rofiles-fuse-symlink-stamp
|
tests/ostree-remount-symlink-stamp tests/rofiles-fuse-symlink-stamp
|
||||||
|
|
@ -53,7 +56,6 @@ dist_test_scripts = \
|
||||||
tests/test-parent.sh \
|
tests/test-parent.sh \
|
||||||
tests/test-pull-archive-z.sh \
|
tests/test-pull-archive-z.sh \
|
||||||
tests/test-pull-commit-only.sh \
|
tests/test-pull-commit-only.sh \
|
||||||
tests/test-pull-corruption.sh \
|
|
||||||
tests/test-pull-depth.sh \
|
tests/test-pull-depth.sh \
|
||||||
tests/test-pull-mirror-summary.sh \
|
tests/test-pull-mirror-summary.sh \
|
||||||
tests/test-pull-large-metadata.sh \
|
tests/test-pull-large-metadata.sh \
|
||||||
|
|
@ -104,10 +106,10 @@ if USE_LIBSOUP
|
||||||
dist_test_scripts += tests/test-remote-cookies.sh
|
dist_test_scripts += tests/test-remote-cookies.sh
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# This one uses corrupt-repo-ref.js
|
# These call into gjs scripts
|
||||||
js_tests = tests/test-corruption.sh
|
js_tests = tests/test-corruption.sh tests/test-pull-corruption.sh
|
||||||
if BUILDOPT_GJS
|
if BUILDOPT_GJS
|
||||||
dist_test_scripts += tests/test-corruption.sh
|
dist_test_scripts += $(js_tests)
|
||||||
else
|
else
|
||||||
EXTRA_DIST += $(js_tests)
|
EXTRA_DIST += $(js_tests)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
14
configure.ac
14
configure.ac
|
|
@ -37,6 +37,15 @@ CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
|
||||||
])
|
])
|
||||||
AC_SUBST(WARN_CFLAGS)
|
AC_SUBST(WARN_CFLAGS)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for -fsanitize=address in CFLAGS])
|
||||||
|
if echo $CFLAGS | grep -q -e -fsanitize=address; then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
using_asan=yes
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(BUILDOPT_ASAN, [test x$using_asan = xyes])
|
||||||
|
|
||||||
# Initialize libtool
|
# Initialize libtool
|
||||||
LT_PREREQ([2.2.4])
|
LT_PREREQ([2.2.4])
|
||||||
LT_INIT([disable-static])
|
LT_INIT([disable-static])
|
||||||
|
|
@ -305,8 +314,9 @@ AC_ARG_WITH(static-compiler,
|
||||||
AM_CONDITIONAL(BUILDOPT_USE_STATIC_COMPILER, test x$with_static_compiler != xno)
|
AM_CONDITIONAL(BUILDOPT_USE_STATIC_COMPILER, test x$with_static_compiler != xno)
|
||||||
AC_SUBST(STATIC_COMPILER, $with_static_compiler)
|
AC_SUBST(STATIC_COMPILER, $with_static_compiler)
|
||||||
|
|
||||||
dnl for tests
|
dnl for tests (but we can't use asan with gjs or any introspection,
|
||||||
AS_IF([test "x$found_introspection" = xyes], [
|
dnl see https://github.com/google/sanitizers/wiki/AddressSanitizerAsDso for more info)
|
||||||
|
AS_IF([test "x$found_introspection" = xyes && test x$using_asan != xyes], [
|
||||||
AC_PATH_PROG(GJS, [gjs])
|
AC_PATH_PROG(GJS, [gjs])
|
||||||
if test -n "$GJS"; then
|
if test -n "$GJS"; then
|
||||||
have_gjs=yes
|
have_gjs=yes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue