diff --git a/ci/test.sh b/ci/test.sh index 9cfb8e5..bf6adad 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -13,6 +13,13 @@ cargo test --manifest-path core/Cargo.toml cargo test --features="travisci" --manifest-path bbqtest/Cargo.toml -- --nocapture cargo test --features="travisci" --release --manifest-path bbqtest/Cargo.toml -- --nocapture +if [ $TRAVIS_RUST_VERSION = nightly ]; then + export RUSTFLAGS="-Z sanitizer=thread" + export RUST_TEST_THREADS=1 + export TSAN_OPTIONS="suppressions=$(pwd)/tsan-blacklist.txt" +fi + # Test using a full std crate, long test with a single thread (it's faster) cargo test --manifest-path bbqtest/Cargo.toml -- --nocapture --test-threads=1 cargo test --release --manifest-path bbqtest/Cargo.toml -- --nocapture --test-threads=1 + diff --git a/tsan-blacklist.txt b/tsan-blacklist.txt new file mode 100644 index 0000000..bf051e5 --- /dev/null +++ b/tsan-blacklist.txt @@ -0,0 +1,7 @@ +# false positives in thread::spawn (?) +race:*dealloc +race:*drop_slow* +race:__call_tls_dtors + +# false positives in scoped_threadpool (?) +race:*drop*