Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,29 @@ then
exit 0
fi

# Test without any features first
cargo test --verbose
# Defaults / sanity checks
cargo test

# Test each feature
for feature in ${FEATURES}
do
cargo test --verbose --features="$feature"
done
if [ "$DO_FEATURE_MATRIX" = true ]
then
# All features
cargo test --features="$FEATURES"

# Single features
for feature in ${FEATURES}
do
cargo test --features="$feature"
done

# Also build and run each example to catch regressions
cargo build --examples
# run all examples
run-parts ./target/debug/examples
# Run all the examples
cargo build --examples
cargo run --example htlc --features=compiler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: There is a white space at the end of this line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo, means I did not read the diff before pushing, bad Tobin. Thanks man, I'll fix it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the diff and I missed this too, oops! Thanks Sanket.

cargo run --example parse
cargo run --example sign_multisig
cargo run --example verify_tx > /dev/null
cargo run --example psbt
cargo run --example xpub_descriptors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why manually list examples instead of run-parts? Is it because of the extra args to each example? We need to remember to add examples here every time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its so the script can be run locally, but yes as you say there is a maintenance cost. Is it worth it, I don't know? I configure target-dir to be a global build cache so there is no target directory when I build so the examples don't run.

fi

# Bench if told to (this only works with the nightly toolchain)
if [ "$DO_BENCH" = true ]
Expand Down