#!/usr/bin/env bash set -u binary=${1:?Expected the ThreadSanitizer test executable} writer_binary=${2:?Expected the writer lifecycle test executable} result=0 for scenario in independent service service-lifetime service-reconfigure custom-state formatter shared-state-lifetime factory-state collector formatter-lifetime timestamp allocator; do echo "ThreadSanitizer scenario: $scenario" if TSAN_OPTIONS=halt_on_error=1:exitcode=66 timeout 30s "$binary" "$scenario"; then echo "PASS: $scenario" else code=$? echo "FAIL: $scenario (exit $code)" >&2 result=1 fi done echo "ThreadSanitizer scenario: writer-lifecycle" if TSAN_OPTIONS=halt_on_error=1:exitcode=66 timeout 30s "$writer_binary" 'Background writer lifecycle::*'; then echo "PASS: writer-lifecycle" else code=$? echo "FAIL: writer-lifecycle (exit $code)" >&2 result=1 fi exit "$result"