light/tools/ci/amd64/gcc/valgrind.sh

34 lines
805 B
Bash
Raw Normal View History

#!/bin/bash
export DEBUGINFOD_URLS="https://debuginfod.archlinux.org/"
set -e
cd $(git rev-parse --show-toplevel)/
2025-10-08 08:58:27 +03:30
rm -rf ./build && mkdir build/
Xvfb :99 -screen 0 1024x768x16 &
export CXX=$(which g++)
export CC=$(which gcc)
export DISPLAY=:99
2025-09-21 14:15:33 +03:30
# gcc uses libstdc++ by default
2025-10-08 08:58:27 +03:30
cmake . \
-Bbuild \
-GNinja \
-DCMAKE_LINKER_TYPE=MOLD \
-DENABLE_UNIT_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
2025-09-21 14:15:33 +03:30
-DCMAKE_CXX_FLAGS="-std=c++23 -g -fno-omit-frame-pointer" \
2025-10-08 09:02:15 +03:30
&& cmake --build ./build -j `nproc`
2025-09-10 15:18:26 +03:30
2025-10-08 09:02:15 +03:30
for test in $(find ./build -type f -name '*_tests' -executable); do
echo "Running $test"
valgrind \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--suppressions='./tools/ci/amd64/gcc/valgrind_suppressions' \
--error-exitcode=255 ${test} || exit 1
2025-09-10 15:18:26 +03:30
done