2020-05-06 07:15:09 +08:00
|
|
|
#!/bin/bash
|
2018-08-19 19:02:16 +08:00
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
CACHEDIR="$HOME/cache"
|
|
|
|
|
2022-01-10 09:17:46 +08:00
|
|
|
. ".github/scripts/flags-$CC.sh"
|
2018-08-19 19:02:16 +08:00
|
|
|
add_flag -Werror
|
2018-08-20 05:34:02 +08:00
|
|
|
add_flag -fdiagnostics-color=always
|
2020-04-05 01:49:03 +08:00
|
|
|
add_flag -fno-omit-frame-pointer
|
2022-02-08 09:06:59 +08:00
|
|
|
add_flag -fsanitize=address
|
2020-05-06 07:15:09 +08:00
|
|
|
cmake -B_build -H. -GNinja \
|
|
|
|
-DCMAKE_C_FLAGS="$C_FLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
|
|
|
|
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
|
|
|
|
-DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \
|
2022-02-08 06:38:26 +08:00
|
|
|
-DCMAKE_UNITY_BUILD=ON \
|
2020-05-06 07:15:09 +08:00
|
|
|
-DMIN_LOGGER_LEVEL=TRACE \
|
|
|
|
-DMUST_BUILD_TOXAV=ON \
|
|
|
|
-DNON_HERMETIC_TESTS=ON \
|
|
|
|
-DSTRICT_ABI=ON \
|
|
|
|
-DTEST_TIMEOUT_SECONDS=120 \
|
|
|
|
-DUSE_IPV6=OFF \
|
2022-02-24 00:00:53 +08:00
|
|
|
-DAUTOTEST=ON \
|
|
|
|
-DBUILD_MISC_TESTS=ON \
|
|
|
|
-DBUILD_FUN_UTILS=ON
|
2018-08-19 19:02:16 +08:00
|
|
|
|
|
|
|
cd _build
|
|
|
|
|
2020-05-06 07:15:09 +08:00
|
|
|
ninja install -j"$(nproc)"
|
2018-08-19 19:02:16 +08:00
|
|
|
|
2022-02-08 09:06:59 +08:00
|
|
|
export ASAN_OPTIONS="color=always"
|
|
|
|
export ASAN_OPTIONS="$ASAN_OPTIONS,detect_invalid_pointer_pairs=1"
|
2018-08-27 03:08:34 +08:00
|
|
|
export ASAN_OPTIONS="$ASAN_OPTIONS,detect_stack_use_after_return=1"
|
|
|
|
export ASAN_OPTIONS="$ASAN_OPTIONS,strict_init_order=1"
|
|
|
|
export ASAN_OPTIONS="$ASAN_OPTIONS,strict_string_checks=1"
|
2020-04-05 01:49:03 +08:00
|
|
|
export ASAN_OPTIONS="$ASAN_OPTIONS,symbolize=1"
|
2022-01-16 09:51:01 +08:00
|
|
|
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6
|