summaryrefslogtreecommitdiff
path: root/.circleci/cmake-tsan
blob: 5d4453fff04fcf354325a1680f99c10ed3e4b172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

set -eu

CACHEDIR="$HOME/cache"

. ".travis/flags-$CC.sh"
add_flag -Werror
add_flag -fdiagnostics-color=always
add_flag -fsanitize=thread
cmake -H. -B_build -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"	\
  -DTRACE=ON					\
  -DMUST_BUILD_TOXAV=ON				\
  -DSTRICT_ABI=ON				\
  -DTEST_TIMEOUT_SECONDS=120			\
  -DUSE_IPV6=OFF

cd _build

ninja install -j$(nproc)

export TSAN_OPTIONS="halt_on_error=1"
export TSAN_OPTIONS="$TSAN_OPTIONS,second_deadlock_stack=1"
ctest -j50 --output-on-failure ||
ctest -j50 --output-on-failure --rerun-failed