44 lines
1.1 KiB
Bash
Executable file
44 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
cd $(git rev-parse --show-toplevel)/
|
|
rm -rf ./build && mkdir build/
|
|
|
|
Xvfb :99 -screen 0 1024x768x16 &
|
|
export CXX=$(which clang++)
|
|
export CC=$(which clang)
|
|
export DISPLAY=:99
|
|
export PKG_CONFIG_PATH=/msan/lib/pkgconfig:${PKG_CONFIG_PATH}
|
|
|
|
cmake . \
|
|
-Bbuild \
|
|
-GNinja \
|
|
-DCMAKE_INCLUDE_PATH=/msan/include \
|
|
-DCMAKE_LIBRARY_PATH=/msan/lib \
|
|
-DCMAKE_PREFIX_PATH=/msan \
|
|
-DCMAKE_LINKER_TYPE=MOLD \
|
|
-DENABLE_UNIT_TESTS=ON \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_CXX_FLAGS=" \
|
|
-fsanitize=memory \
|
|
-fsanitize-memory-track-origins \
|
|
-fno-omit-frame-pointer \
|
|
-g \
|
|
-std=c++23 \
|
|
-nostdinc++ \
|
|
-isystem /libcxx_msan/include/c++/v1/" \
|
|
-DCMAKE_EXE_LINKER_FLAGS=" \
|
|
-fsanitize=memory \
|
|
-fsanitize-memory-track-origins \
|
|
-L/msan/lib -Wl,-rpath,/msan/lib \
|
|
-L/libcxx_msan/lib -Wl,-rpath,/libcxx_msan/lib \
|
|
-lc++ \
|
|
-lc++abi" \
|
|
&& cmake --build ./build --target='assets_tests' -j`nproc`
|
|
|
|
export MSAN_SYMBOLIZER_PATH="$(which llvm-symbolizer)"
|
|
export MSAN_OPTIONS="fast_unwind_on_malloc=0:verbosity=1:report_umrs=1"
|
|
for test in $(find ./build -type f -name '*_tests' -executable); do
|
|
echo "Running $test"
|
|
"$test"
|
|
done
|