Add AddressSanitizer and MemorySanitizer support

This commit is contained in:
Elichai Turkel 2020-08-28 19:29:28 +03:00
parent b2e315f154
commit 9dfb329ff1
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
1 changed files with 13 additions and 3 deletions

View File

@ -55,9 +55,19 @@ script:
- cargo run --example generate_keys --features=rand - cargo run --example generate_keys --features=rand
- if [ ${TRAVIS_RUST_VERSION} == "stable" ]; then cargo doc --verbose --features="rand,serde,recovery,endomorphism"; fi - if [ ${TRAVIS_RUST_VERSION} == "stable" ]; then cargo doc --verbose --features="rand,serde,recovery,endomorphism"; fi
- if [ ${TRAVIS_RUST_VERSION} == "nightly" ]; then cargo test --verbose --benches --features=unstable; fi - if [ ${TRAVIS_RUST_VERSION} == "nightly" ]; then cargo test --verbose --benches --features=unstable; fi
- if [ ${TRAVIS_RUST_VERSION} == "nightly" -a "$TRAVIS_OS_NAME" = "linux" ]; then - |
cd no_std_test && if [ ${TRAVIS_RUST_VERSION} == "nightly" -a "$TRAVIS_OS_NAME" = "linux" ]; then
cargo run --release | grep -q "Verified Successfully"; cargo clean
rustup component add rust-src
CC='clang -fsanitize=address -fno-omit-frame-pointer' \
RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \
ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \
cargo test --lib --verbose --features="rand-std serde recovery bitcoin_hashes" -Zbuild-std --target x86_64-unknown-linux-gnu &&
cargo clean &&
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes' \
cargo test --lib --verbose --features="rand-std serde recovery bitcoin_hashes" -Zbuild-std --target x86_64-unknown-linux-gnu &&
cd no_std_test && cargo run --release | grep -q "Verified Successfully"
fi fi
- if [ ${TRAVIS_RUST_VERSION} == "stable" -a "$TRAVIS_OS_NAME" = "linux" ]; then - if [ ${TRAVIS_RUST_VERSION} == "stable" -a "$TRAVIS_OS_NAME" = "linux" ]; then
clang --version && clang --version &&