Add support for make verify WHAT=typecheck.

This will be used to make the typecheck job emit junit and avoids
duplicating the rest of the verify logic.
This commit is contained in:
Ryan Hitchman 2018-02-28 20:44:37 -08:00
parent f6e23e32f9
commit d295ca1134
2 changed files with 26 additions and 7 deletions

View File

@ -112,10 +112,12 @@ define VERIFY_HELP_INFO
#
# Args:
# BRANCH: Branch to be passed to verify-godeps.sh script.
# WHAT: List of checks to run
#
# Example:
# make verify
# make verify BRANCH=branch_x
# make verify WHAT="bazel typecheck"
endef
.PHONY: verify
ifeq ($(PRINT_HELP),y)

View File

@ -73,6 +73,17 @@ function is-quick {
return 1
}
function is-explicitly-chosen {
local name="${1#verify-}"
name="${name%.*}"
for e in ${WHAT}; do
if [[ $e == "$name" ]]; then
return
fi
done
return 1
}
function run-cmd {
local filename="${2##*/verify-}"
local testname="${filename%%.*}"
@ -109,6 +120,11 @@ function run-checks {
for t in $(ls ${pattern})
do
local check_name="$(basename "${t}")"
if [[ ! -z ${WHAT:-} ]]; then
if ! is-explicitly-chosen "${check_name}"; then
continue
fi
else
if is-excluded "${t}" ; then
echo "Skipping ${check_name}"
continue
@ -117,6 +133,7 @@ function run-checks {
echo "Skipping ${check_name} in quick mode"
continue
fi
fi
echo -e "Verifying ${check_name}"
local start=$(date +%s)
run-cmd "${runner}" "${t}" && tr=$? || tr=$?