diff --git a/.travis.yml b/.travis.yml index 490b3bb..9d1cb69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,14 +47,20 @@ jobs: - dist: xenial compiler: clang arch: arm64 + # ASAN fails with internal error + env: DISABLE_ASAN=1 - dist: xenial compiler: gcc arch: ppc64le + # ASAN fails with internal error + env: DISABLE_ASAN=1 - dist: xenial compiler: clang arch: ppc64le + # ASAN fails with internal error + env: DISABLE_ASAN=1 - dist: xenial compiler: gcc diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 482565d..0e1b3be 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -35,6 +35,13 @@ CC_VERSION=$($CC --version | head -1) ARCH=$(uname -m) +# Allow setting DISABLE_ASAN=1 in the environment to disable the ASAN tests. +if [ "${DISABLE_ASAN:-}" = "1" ]; then + DISABLE_ASAN=true +else + DISABLE_ASAN=false +fi + ############################################################################### INDENT=0 @@ -250,6 +257,17 @@ run_tests() { log "Skipping UBSAN tests because compiler ($CC_VERSION) doesn't support UBSAN" fi + cflags=("-fsanitize=address" "-fno-sanitize-recover=address") + if $DISABLE_ASAN; then + log "Skipping ASAN tests because DISABLE_ASAN=1 was set" + elif cflags_supported "${cflags[@]}"; then + begin "Running tests with ASAN" + CFLAGS="$CFLAGS ${cflags[*]}" do_run_tests --quick + end + else + log "Skipping ASAN tests because compiler ($CC_VERSION) doesn't support ASAN" + fi + install_uninstall_tests check_symbol_prefixes }