diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bed0cbbf..98261d86 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -202,7 +202,7 @@ aarch64-debian-container_prep: - $BUILDDIR/weston-virtme - $PREFIX reports: - junit: $BUILDDIR/meson-logs/testlog.junit.xml + junit: $BUILDDIR/meson-logs/testlog-per-test-asan.sh.junit.xml # Same as above, but without running any tests. .build-no-test: diff --git a/.gitlab-ci/virtme-scripts/per-test-asan.sh b/.gitlab-ci/virtme-scripts/per-test-asan.sh new file mode 100755 index 00000000..044ac6d2 --- /dev/null +++ b/.gitlab-ci/virtme-scripts/per-test-asan.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# When running Debian's Xwayland and fontconfig, we hit memory leaks which +# aren't visible on other setups. We do have suppressions for these tests, but +# regrettably ASan can't see through omitted frame pointers in Expat, so for +# Xwayland specifically, we disable fast-unwind. +# +# Doing it globally makes the other tests far, far, too slow to run. +case "$1" in + *xwayland*) + export ASAN_OPTIONS="detect_leaks=0,fast_unwind_on_malloc=0" + ;; + *) + export ASAN_OPTIONS="detect_leaks=0" + ;; +esac + +export ASAN_OPTIONS + +exec "$@" diff --git a/.gitlab-ci/virtme-scripts/run-weston-tests.sh b/.gitlab-ci/virtme-scripts/run-weston-tests.sh index a45f9668..2b156333 100755 --- a/.gitlab-ci/virtme-scripts/run-weston-tests.sh +++ b/.gitlab-ci/virtme-scripts/run-weston-tests.sh @@ -26,13 +26,13 @@ export HOME=/root export PATH=$HOME/.local/bin:$PATH export PATH=/usr/local/bin:$PATH -export ASAN_OPTIONS=detect_leaks=0,atexit=1 export SEATD_LOGLEVEL=debug # run the tests and save the exit status # we give ourselves a very generous timeout multiplier due to ASan overhead echo 0x1f > /sys/module/drm/parameters/debug -seatd-launch -- meson test --no-rebuild --timeout-multiplier 4 +seatd-launch -- meson test --no-rebuild --timeout-multiplier 4 \ + --wrapper $(pwd)/../.gitlab-ci/virtme-scripts/per-test-asan.sh # note that we need to store the return value from the tests in order to # determine if the test suite ran successfully or not. TEST_RES=$?