Skip to content

Commit 8de1d3b

Browse files
committed
New scripts for testing
For testing in development and CI
1 parent 0b90d21 commit 8de1d3b

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

scripts/test-all.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
./test-stable.sh
6+
./test-nightly.sh

scripts/test-common.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
STABLE_FEATURES=(
2+
alloc
3+
serde
4+
std
5+
)
6+
7+
test_with_feature() {
8+
local feature=$1
9+
/bin/echo -e "\e[0;33m***** Testing with feature '${feature}' *****\e[0m\n"
10+
cargo test --features "${feature}" --no-default-features --verbose
11+
}

scripts/test-nightly.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
. ./test-common.sh --source-only
5+
6+
# All nightly features individually
7+
8+
NIGHTLY_FEATURES=(
9+
may_dangle
10+
specialization
11+
union
12+
)
13+
14+
for feature in "${NIGHTLY_FEATURES[@]}"; do
15+
test_with_feature $feature
16+
done
17+
18+
# All nightly features individually with constant generics
19+
20+
# for feature in "${STABLE_FEATURES[@]}"; do
21+
# test_with_feature "const_generic, $feature"
22+
# done
23+
24+
# for feature in "${NIGHTLY_FEATURES[@]}"; do
25+
# test_with_feature "const_generic, $feature"
26+
# done
27+
28+
# All features
29+
30+
# /bin/echo -e "\e[0;33m***** Testing all features *****\e[0m\n"
31+
# cargo test --all-features --no-default-features --verbose
32+
33+
# Run bench
34+
35+
/bin/echo -e "\e[0;33m***** Running bench *****\e[0m\n"
36+
cargo bench --verbose bench

scripts/test-stable.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
. ./test-common.sh --source-only
5+
6+
# No features
7+
8+
/bin/echo -e "\e[0;33m***** Testing without features *****\e[0m\n"
9+
cargo test --no-default-features --verbose
10+
11+
# All stable features individually
12+
13+
for feature in "${STABLE_FEATURES[@]}"; do
14+
test_with_feature $feature
15+
done
16+
17+
# All stable features at once
18+
19+
test_with_feature $(IFS=, ; echo "${STABLE_FEATURES[*]}")

0 commit comments

Comments
 (0)