#!/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.* ../sanitizer.log touch sanitizer.log exit $STATUS_CODE