Avoid empty --features= arg to avoid unnecessary cargo building

This commit is contained in:
Michael Vines 2019-02-07 09:47:34 -08:00 committed by Grimes
parent eb3ba5ce2d
commit 6317bec7aa
2 changed files with 9 additions and 4 deletions

View File

@ -26,8 +26,7 @@ build() {
$genPipeline && return
ci/version-check-with-upgrade.sh stable
_ scripts/ulimit-n.sh
FEATURES=""
_ cargo build --all --features="$FEATURES"
_ cargo build --all
}
runTest() {

View File

@ -12,8 +12,14 @@ export RUST_BACKTRACE=1
export RUSTFLAGS="-D warnings"
source scripts/ulimit-n.sh
_ cargo build --all ${V:+--verbose} --features="$FEATURES"
_ cargo test --all ${V:+--verbose} --features="$FEATURES" --lib -- --nocapture --test-threads=1
maybeFeatures=
if [[ -n $FEATURES ]]; then
maybeFeatures="--features=$FEATURES"
fi
# shellcheck disable=SC2086 # Don't want to double quote $maybeFeatures
_ cargo build --all ${V:+--verbose} $maybeFeatures
# shellcheck disable=SC2086 # Don't want to double quote $maybeFeatures
_ cargo test --all ${V:+--verbose} $maybeFeatures --lib -- --nocapture --test-threads=1
# Run native program tests (without $FEATURES)
for program in programs/native/*; do