#!/usr/bin/env bash mkdir cmake-build-release-thread-sanitizer cd cmake-build-release-thread-sanitizer cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DTHREAD_SANITIZER=ON make # run the actual tests with sanitizer enabled, reporting the result TSAN_OPTIONS="log_path=sanitizer.log exitcode=1" ./bin/tests STATUS_CODE=$? # rename the output log... mv ./sanitizer.log.* ../thread-sanitizer.log if [[ $? != 0 ]]; then echo "No sanitizer warnings." > ../thread-sanitizer.log fi exit $STATUS_CODE