run_thread_sanitizer.sh 395 Bytes
Newer Older
1 2
#!/usr/bin/env bash

3
mkdir cmake-build-release-thread-sanitizer
4 5 6 7 8
cd cmake-build-release
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DTHREAD_SANITIZER=ON
make

# run the actual tests with sanitizer enabled, reporting the result
9 10 11 12 13 14 15 16
TSAN_OPTIONS="log_path=sanitizer.log exitcode=1" ./bin/tests
STATUS_CODE=?$

# rename the output log...
mv sanitizer.log.* sanitizer.log
touch sanitizer.log

exit $STATUS_CODE