Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions tests/asan-check/run_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@ function check_with_asan() {
local n_procs use_procs
n_procs="$(getconf _NPROCESSORS_ONLN)"
use_procs=$((n_procs/2))
if [ "$use_procs" -lt "1" ]; then
if [ "$use_procs" -lt 1 ]; then
use_procs=1
fi

local asan_flags="-fsanitize=address"

./autogen.sh --enable-debug &&
# Assume we are in core directory
if [ -f ./configure ] ; then
./configure -C --enable-debug
else
./autogen.sh -C --enable-debug
fi
make -j"${use_procs}" CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare ${asan_flags}" LDFLAGS="${asan_flags}" &&
make -C tests/unit CFLAGS="${asan_flags}" LDFLAGS="${asan_flags}" check
}

cd "$(dirname "$0")"/../../

failure=0
if ! check_with_asan; then
echo "FAIL: ASAN compile/unit check failed";
failure=1;
exit 1;
fi
exit $failure
Loading