Skip to content

Commit e4fb575

Browse files
committed
Merge #422: Fix test script silent failure
97dc0ea Run correct clang --version (Tobin Harding) a3582ff test.sh: Use set -e to exit on failure (Tobin Harding) 7bec31c test.sh: explicitly return 0 (Tobin Harding) Pull request description: Change the test script to exit with non-zero status code if any command fails. The `test.sh` script is silently failing, that means changes causing failures are slipping through our CI pipeline and being merged. Resolves: #419 ## Note Just the last 3 patches, the first 6 are from #420. re-base just shows it works on top of 420, it is going to have to be rebased again when 420 merges. ACKs for top commit: apoelstra: ACK 97dc0ea Tree-SHA512: b86a6876d8c45a2b90b7b3c8adbc08ad6f49b430b1cfaec31cd2de8441cb96af39c63da02b98d6ed71dfab045d466d71d3757297886b5e44ebb6cbaeb4ed32dd
2 parents 8caf41d + 97dc0ea commit e4fb575

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

contrib/test.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh -ex
22

3+
set -e
4+
35
# TODO: Add "alloc" once we bump MSRV to past 1.29
46
FEATURES="bitcoin_hashes global-context lowmemory rand recovery serde std"
57
# These features are typically enabled along with the 'std' feature, so we test
@@ -67,24 +69,25 @@ fi
6769

6870
# Webassembly stuff
6971
if [ "$DO_WASM" = true ]; then
70-
clang --version &&
71-
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack &&
72-
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml &&
73-
CC=clang-9 wasm-pack build &&
74-
CC=clang-9 wasm-pack test --node;
72+
clang-9 --version
73+
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack
74+
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml
75+
CC=clang-9 wasm-pack build
76+
CC=clang-9 wasm-pack test --node
7577
fi
7678

7779
# Address Sanitizer
7880
if [ "$DO_ASAN" = true ]; then
81+
clang --version
7982
cargo clean
8083
CC='clang -fsanitize=address -fno-omit-frame-pointer' \
8184
RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \
8285
ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \
83-
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu &&
84-
cargo clean &&
86+
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu
87+
cargo clean
8588
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
8689
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes' \
87-
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu &&
90+
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu
8891
cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully"
8992
cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully"
9093
fi
@@ -94,3 +97,4 @@ if [ "$DO_BENCH" = true ]; then
9497
cargo bench --all --features="unstable"
9598
fi
9699

100+
exit 0

0 commit comments

Comments
 (0)