Merge pull request #1159 from filbranden/hack_test_goflags1

In hack/test-go.sh, treat arguments that start with a dash as go flags.
This commit is contained in:
Tim Hockin 2014-09-03 15:34:38 -07:00
commit bf2170641b
2 changed files with 21 additions and 5 deletions

View File

@ -44,14 +44,19 @@ if [[ $# == 0 ]]; then
plugin/cmd/scheduler
fi
binaries=()
for arg; do
binaries+=("${KUBE_GO_PACKAGE}/${arg}")
done
# Use eval to preserve embedded quoted strings.
eval "goflags=(${GOFLAGS:-})"
binaries=()
for arg; do
if [[ "${arg}" == -* ]]; then
# Assume arguments starting with a dash are flags to pass to go.
goflags+=("${arg}")
else
binaries+=("${KUBE_GO_PACKAGE}/${arg}")
fi
done
# Note that the flags to 'go build' are duplicated in the salt build setup
# (release/build-release.sh) for our cluster deploy. If we add more command
# line options to our standard build we'll want to duplicate them there. As we

View File

@ -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)