Skip to content

Commit 91eea11

Browse files
authored
Merge pull request #256 from rust-bitcoin/workspace
Make test.sh test and build secp256k1-sys
2 parents a2c25f2 + 21f231b commit 91eea11

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ name = "sign_verify"
5454
[[example]]
5555
name = "generate_keys"
5656
required-features = ["rand"]
57+
58+
[workspace]
59+
members = ["secp256k1-sys"]
60+
exclude = ["no_std_test"]

contrib/test.sh

+22-19
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,33 @@ fi
1111
cargo --version
1212
rustc --version
1313

14+
# Make all cargo invocations verbose
15+
export CARGO_TERM_VERBOSE=true
16+
1417
# Defaults / sanity checks
15-
cargo build --verbose
16-
cargo test --verbose
18+
cargo build --all
19+
cargo test --all
1720

1821
if [ "$DO_FEATURE_MATRIX" = true ]; then
19-
cargo build --verbose --no-default-features
22+
cargo build --all --no-default-features
2023
#This doesn't work but probably should --andrew
21-
#cargo test --verbose --no-default-features
24+
#cargo test --all --no-default-features
2225

2326
# All features
24-
cargo build --verbose --no-default-features --features="$FEATURES"
25-
cargo test --verbose --features="$FEATURES"
27+
cargo build --all --no-default-features --features="$FEATURES"
28+
cargo test --all --features="$FEATURES"
2629
# Single features
2730
for feature in ${FEATURES}
2831
do
29-
cargo build --verbose --no-default-features --features="$feature"
30-
cargo test --verbose --features="$feature"
32+
cargo build --all --no-default-features --features="$feature"
33+
cargo test --all --features="$feature"
3134
done
3235

33-
# Other combos
34-
RUSTFLAGS='--cfg=rust_secp_fuzz' cargo test --no-run --verbose
35-
RUSTFLAGS='--cfg=rust_secp_fuzz' cargo test --no-run --verbose --features="recovery"
36-
cargo test --verbose --features="rand rand-std"
37-
cargo test --verbose --features="rand serde"
36+
# Other combos
37+
RUSTFLAGS='--cfg=rust_secp_fuzz' cargo test --no-run --all
38+
RUSTFLAGS='--cfg=rust_secp_fuzz' cargo test --no-run --all --features="recovery"
39+
cargo test --all --features="rand rand-std"
40+
cargo test --all --features="rand serde"
3841

3942
# Examples
4043
cargo run --example sign_verify
@@ -44,13 +47,13 @@ fi
4447

4548
# Docs
4649
if [ "$DO_DOCS" = true ]; then
47-
cargo doc --verbose --features="$FEATURES"
50+
cargo doc --all --features="$FEATURES"
4851
fi
4952

5053
# Webassembly stuff
5154
if [ "$DO_WASM" = true ]; then
5255
clang --version &&
53-
CARGO_TARGET_DIR=wasm cargo install --verbose --force wasm-pack &&
56+
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack &&
5457
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml &&
5558
CC=clang-9 wasm-pack build &&
5659
CC=clang-9 wasm-pack test --node;
@@ -62,16 +65,16 @@ if [ "$DO_ASAN" = true ]; then
6265
CC='clang -fsanitize=address -fno-omit-frame-pointer' \
6366
RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \
6467
ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \
65-
cargo test --lib --verbose --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu &&
68+
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu &&
6669
cargo clean &&
6770
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
6871
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes' \
69-
cargo test --lib --verbose --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu &&
70-
cd no_std_test && cargo run --release | grep -q "Verified Successfully"
72+
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu &&
73+
cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully"
7174
fi
7275

7376
# Bench
7477
if [ "$DO_BENCH" = true ]; then
75-
cargo bench --features="unstable"
78+
cargo bench --all --features="unstable"
7679
fi
7780

0 commit comments

Comments
 (0)