Skip to content

Commit

Permalink
Add NIGHTLY variable to CI script
Browse files Browse the repository at this point in the history
We are currently using the DO_BENCH variable as a proxy for whether or
not we are using a nightly toolchain, while this is technically correct
we use it from within an if guarded statement that is guarded by
DO_FEATURE_MATRIX and we never run the CI script with _both_ of these
variables set to true. This means that the all features test is never
being run.

Add a NIGHTLY variable and set it based on the output of `cargo
--version`.
  • Loading branch information
tcharding committed Jun 28, 2022
1 parent e8454cd commit ac7bbbc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contrib/test.sh
Expand Up @@ -17,6 +17,12 @@ fi
cargo --version
rustc --version

# Work out if we are using a nightly toolchain.
NIGHTLY=false
if cargo --version | grep nightly; then
NIGHTLY=true
fi

# Test if panic in C code aborts the process (either with a real panic or with SIGILL)
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]"

Expand Down Expand Up @@ -51,7 +57,7 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
RUSTFLAGS='--cfg=fuzzing' RUSTDOCFLAGS=$RUSTFLAGS cargo test --all --features="$FEATURES"
cargo test --all --features="rand serde"

if [ "$DO_BENCH" = true ]; then # proxy for us having a nightly compiler
if [ "$NIGHTLY" = true ]; then
cargo test --all --all-features
RUSTFLAGS='--cfg=fuzzing' RUSTDOCFLAGS='--cfg=fuzzing' cargo test --all --all-features
fi
Expand Down

0 comments on commit ac7bbbc

Please sign in to comment.