From 8effbdc63feb7007bde3b76d5bce2949870de3f0 Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 3 Sep 2014 14:19:36 -0700 Subject: [PATCH] In `hack/test-go.sh` treat arguments that start with a dash as go flags. This fixes `hack/test-go.sh pkg/apiserver -test.run=` which was broken by PR #1116. Signed-off-by: Filipe Brandenburger --- hack/test-go.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hack/test-go.sh b/hack/test-go.sh index 8f096f08a20..ff247c09d47 100755 --- a/hack/test-go.sh +++ b/hack/test-go.sh @@ -94,6 +94,17 @@ shift $((OPTIND - 1)) # Use eval to preserve embedded quoted strings. eval "goflags=(${GOFLAGS:-})" +# Filter out arguments that start with "-" and move them to goflags. +testcases=() +for arg; do + if [[ "${arg}" == -* ]]; then + goflags+=("${arg}") + else + testcases+=("${arg}") + fi +done +set -- ${testcases[@]+"${testcases[@]}"} + if [[ "${iterations}" -gt 1 ]]; then if [[ $# -eq 0 ]]; then set -- $(find_test_dirs)