mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
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:
commit
bf2170641b
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user