forked from rust-bitcoin/rust-bip39
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·71 lines (56 loc) · 2.03 KB
/
test.sh
File metadata and controls
executable file
·71 lines (56 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
set -ex
FEATURES="serde rand all-languages chinese-simplified chinese-traditional czech french italian japanese korean portuguese spanish"
cargo --version
rustc --version
# Pin dependencies as required if we are using MSRV toolchain.
if cargo --version | grep "1\.41"; then
cp Cargo-minimal.lock Cargo.lock
cargo check --locked
rm Cargo.lock
cargo update --package "bitcoin_hashes" --precise "0.12.0"
cargo update --package "rand" --precise "0.6.0"
cargo update --package "libc" --precise "0.2.151"
cargo update --package "tinyvec" --precise "1.6.0"
cargo update --package "unicode-normalization" --precise "0.1.22"
fi
echo "********* Testing std *************"
# Test without any features other than std first
cargo test --verbose --no-default-features --features="std"
echo "********* Testing default *************"
# Then test with the default features
cargo test --verbose
# Build specific features
for feature in ${FEATURES}
do
cargo build --verbose --features="$feature" --no-default-features
done
if cargo --version | grep -v "1\.41"; then
cargo build --verbose --features="zeroize" --no-default-features
fi
if [ "$DO_NO_STD" = true ]
then
echo "********* Testing no-std build *************"
# Build no_std, to make sure that cfg(test) doesn't hide any issues
cargo build --verbose --no-default-features
# Build std + no_std, to make sure they are not incompatible
cargo build --verbose
# Test no_std
cargo test --verbose --no-default-features
# Build all features
cargo build --verbose --features="$FEATURES" --no-default-features
# Build specific features
for feature in ${FEATURES}
do
cargo build --verbose --features="$feature" --no-default-features
done
if cargo --version | grep -v "1\.41"; then
cargo build --verbose --features="zeroize" --no-default-features
fi
fi
# Test each feature
for feature in ${FEATURES}
do
echo "********* Testing $feature *************"
cargo test --verbose --features="$feature"
done