aboutsummaryrefslogtreecommitdiff
path: root/toolchain_utils_githooks
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2019-04-02 00:02:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-07 06:34:17 -0700
commit3e36a69f75b86489331e16a5099836ed780303b5 (patch)
treed28b89fe3f09b42511ebfb8f03ce39d22ed38389 /toolchain_utils_githooks
parent9d74464d52b2d917e3fcf69aa472cf7cf0d2edb1 (diff)
downloadtoolchain-utils-3e36a69f75b86489331e16a5099836ed780303b5.tar.gz
githooks: make the test runner run on presubmits
Also renames a few things for clarity. BUG=None TEST=repo upload Change-Id: I7fec9cc90be7cea7dac69aae61942ebdd8868247 Reviewed-on: https://chromium-review.googlesource.com/1544903 Commit-Ready: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'toolchain_utils_githooks')
-rwxr-xr-xtoolchain_utils_githooks/check-presubmit (renamed from toolchain_utils_githooks/check-style)1
-rwxr-xr-xtoolchain_utils_githooks/pre-push.real27
2 files changed, 2 insertions, 26 deletions
diff --git a/toolchain_utils_githooks/check-style b/toolchain_utils_githooks/check-presubmit
index c844b1e2..e67611f5 100755
--- a/toolchain_utils_githooks/check-style
+++ b/toolchain_utils_githooks/check-presubmit
@@ -41,6 +41,7 @@ spawn_child() {
spawn_child "${mydir}/check-lint" "$@"
spawn_child "${mydir}/check-format" "$@"
+spawn_child "${mydir}/../run_tests_for.py" "$@"
success=true
for i in "${!child_pids[@]}"; do
diff --git a/toolchain_utils_githooks/pre-push.real b/toolchain_utils_githooks/pre-push.real
index c05a35bf..06aa6213 100755
--- a/toolchain_utils_githooks/pre-push.real
+++ b/toolchain_utils_githooks/pre-push.real
@@ -9,29 +9,6 @@
mydir="$(dirname "$(readlink -m "$0")")"
-# This redirects stdin. Make sure to run after stdin has been read.
-run_UnitTests() {
- save_dir=$(pwd)
- status=0
- valid=0
-
- # Make sure we can read the stdin from terminal
- exec < /dev/tty
-
- while [[ $valid -eq 0 ]] ; do
- read -p "Run unit tests? [y/n] " choice
- case "$choice" in
- n|N ) valid=1 ;;
- y|Y ) valid=1; cd crosperf; ./run_tests.sh; status=$? ;
- cd $save_dir;;
- * ) echo "Must choose y or n."
- esac
- done
- if [[ $status -ne 0 ]]; then
- exit $status
- fi
-}
-
z40=0000000000000000000000000000000000000000
while IFS=' ' read local_ref local_sha remote_ref remote_sha; do
@@ -46,10 +23,8 @@ while IFS=' ' read local_ref local_sha remote_ref remote_sha; do
all_files="$(git show --pretty="format:" --name-only "${range}")"
# Note that ${all_files} may include files that were deleted. Hence, we
# ignore any complaints about missing files.
- IGNORE_MISSING=1 "${mydir}/check-style" ${all_files} || exit 1
+ IGNORE_MISSING=1 "${mydir}/check-presubmit" ${all_files} || exit 1
fi
done
-run_UnitTests
-
exit 0