Skip to content

Commit 9dfb329

Browse files
committed
Add AddressSanitizer and MemorySanitizer support
1 parent b2e315f commit 9dfb329

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.travis.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,19 @@ script:
5555
- cargo run --example generate_keys --features=rand
5656
- if [ ${TRAVIS_RUST_VERSION} == "stable" ]; then cargo doc --verbose --features="rand,serde,recovery,endomorphism"; fi
5757
- if [ ${TRAVIS_RUST_VERSION} == "nightly" ]; then cargo test --verbose --benches --features=unstable; fi
58-
- if [ ${TRAVIS_RUST_VERSION} == "nightly" -a "$TRAVIS_OS_NAME" = "linux" ]; then
59-
cd no_std_test &&
60-
cargo run --release | grep -q "Verified Successfully";
58+
- |
59+
if [ ${TRAVIS_RUST_VERSION} == "nightly" -a "$TRAVIS_OS_NAME" = "linux" ]; then
60+
cargo clean
61+
rustup component add rust-src
62+
CC='clang -fsanitize=address -fno-omit-frame-pointer' \
63+
RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \
64+
ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \
65+
cargo test --lib --verbose --features="rand-std serde recovery bitcoin_hashes" -Zbuild-std --target x86_64-unknown-linux-gnu &&
66+
cargo clean &&
67+
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
68+
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes' \
69+
cargo test --lib --verbose --features="rand-std serde recovery bitcoin_hashes" -Zbuild-std --target x86_64-unknown-linux-gnu &&
70+
cd no_std_test && cargo run --release | grep -q "Verified Successfully"
6171
fi
6272
- if [ ${TRAVIS_RUST_VERSION} == "stable" -a "$TRAVIS_OS_NAME" = "linux" ]; then
6373
clang --version &&

0 commit comments

Comments
 (0)