Support make test WHAT=.....

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
This commit is contained in:
Andy Goldstein
2019-01-03 15:27:41 -05:00
parent fd8bf14bb6
commit 6cf3db6244
2 changed files with 18 additions and 8 deletions
+15 -3
View File
@@ -20,8 +20,20 @@ set -o pipefail
export CGO_ENABLED=0
TARGETS=$(for d in "$@"; do echo ./$d/...; done)
TARGETS=(
./cmd/...
./pkg/...
)
echo "Running tests:"
go test -installsuffix "static" -timeout 60s ${TARGETS}
if [[ ${#@} -ne 0 ]]; then
TARGETS=("$@")
fi
echo "Running tests:" "${TARGETS[@]}"
if [[ -n "${GOFLAGS:-}" ]]; then
echo "GOFLAGS: ${GOFLAGS}"
fi
go test -installsuffix "static" -timeout 60s "${TARGETS[@]}"
echo "Success!"