feat(docs): Explain supported feature combinations, add test script
This commit is contained in:
parent
7668c9bb7b
commit
1d4e82335d
3 changed files with 82 additions and 8 deletions
69
feat-permut.sh
Executable file
69
feat-permut.sh
Executable file
|
|
@ -0,0 +1,69 @@
|
|||
#!/bin/bash
|
||||
## Build/ Test/ Clippy all supported feature permutations
|
||||
set -eu
|
||||
|
||||
mode=${1:-help}
|
||||
wasm_target="--chrome --headless"
|
||||
extended=${2:-false}
|
||||
|
||||
|
||||
features_base=(
|
||||
#cam,denm,uart
|
||||
spat,gnss,screen
|
||||
)
|
||||
features_more=(
|
||||
spat,gnss,screen,cam,denm
|
||||
)
|
||||
features_test=(
|
||||
spat
|
||||
spat,cam,denm
|
||||
)
|
||||
|
||||
|
||||
runBuild () {
|
||||
for feat in "${features[@]}"; do
|
||||
echo "cargo build for $feat ..."
|
||||
cargo build --release --no-default-features -F esp,$feat
|
||||
done
|
||||
}
|
||||
|
||||
runTest () {
|
||||
for feat in "${features_test[@]}"; do
|
||||
echo "cargo test for $feat ..."
|
||||
cargo test --target host-tuple --bin test --no-default-features -F std,$feat
|
||||
done
|
||||
}
|
||||
|
||||
runClippy () {
|
||||
for feat in "${features[@]}"; do
|
||||
echo "clippy for $feat ..."
|
||||
cargo clippy --no-default-features -F esp,$feat -- -Wclippy::pedantic
|
||||
done
|
||||
}
|
||||
|
||||
if [ $extended == "--more" ]; then
|
||||
echo "running with extended feature list"
|
||||
features=( "${features_base[@]}" "${features_more[@]}" )
|
||||
else
|
||||
echo "running standard feature list"
|
||||
features=( "${features_base[@]}" )
|
||||
fi
|
||||
|
||||
case $mode in
|
||||
build)
|
||||
runBuild
|
||||
;;
|
||||
clippy)
|
||||
runClippy
|
||||
;;
|
||||
test)
|
||||
runTest
|
||||
;;
|
||||
all)
|
||||
runBuild
|
||||
runClippy
|
||||
runTest
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [build | clippy | test | all] [--more]"
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue