From c4f10126e317ef0624c1b524d8181b5139772f4e Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 18 Jul 2021 20:16:34 -0700 Subject: [PATCH] git-hooks: build and test with --no-default-features too. Stores output in separate target/ subdir, so it shouldn't get clobbered. --- git-hooks/pre-commit | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index 3bbeaa8..1c34de0 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -1,5 +1,7 @@ #!/usr/bin/env bash set -e +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + pushd () { command pushd "$@" > /dev/null } @@ -18,9 +20,14 @@ RT=rtchallenge AFFECTED="$(git diff-index --cached --name-only HEAD)" #echo "AFFECTED $AFFECTED" RT_AFFECTED=$(echo "${AFFECTED:?}" | grep ${RT:?} || true) +NO_FEATURES_TARGET_DIR="${SCRIPT_DIR:?}/../../rtchallenge/target/no-default-features" if [ ! -z "$RT_AFFECTED" ]; then echo "Files for the rt challenge were touched, running tests" - cd ${RT:?} && cargo build --examples && cargo test + cd ${RT:?} && \ + cargo build --examples && \ + cargo test && \ + cargo build --target-dir=${NO_FEATURES_TARGET_DIR:?} --no-default-features --examples && \ + cargo test --target-dir=${NO_FEATURES_TARGET_DIR:?} --no-default-features fi # Uncomment to debug presubmit. #exit 1