diff --git a/test.sh b/test.sh index 6c027b36..3846d798 100755 --- a/test.sh +++ b/test.sh @@ -54,10 +54,12 @@ run_if() ( ) unit() ( - eval run_if "${LINT:-true}" cargo clippy "$@" -- -D warnings - eval run_if "${DOC:-false}" cargo doc "$@" - eval run_if "${BUILD:-true}" cargo build "${BUILD_FLAGS:-}" "$@" - eval run_if "${TEST:-true}" cargo test "${TEST_FLAGS:-}" "$@" + read -ra build_flags <<<"${BUILD_FLAGS:-}" + read -ra test_flags <<<"${TEST_FLAGS:-}" + run_if "${LINT:-true}" cargo clippy "$@" -- -D warnings + run_if "${DOC:-false}" cargo doc "$@" + run_if "${BUILD:-true}" cargo build ${build_flags[@]+"${build_flags[@]}"} "$@" + run_if "${TEST:-true}" cargo test ${test_flags[@]+"${test_flags[@]}"} "$@" ) run_if "${FMT:-true}" cargo fmt -- --check