diff options
author | Russ Cox <rsc@golang.org> | 2011-10-19 13:10:23 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-10-19 13:10:23 -0400 |
commit | 35b2bfc8daa9ebeabfae8106e39b223c137f523a (patch) | |
tree | e19bcc1273244c28fa146b3a24c8f2ef929dc0c2 | |
parent | bb8c4ed22abc40a93a31ef4c3c59841773d75e88 (diff) | |
download | go-35b2bfc8daa9ebeabfae8106e39b223c137f523a.tar.gz go-35b2bfc8daa9ebeabfae8106e39b223c137f523a.zip |
gotest: use $GCFLAGS like make does
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5297044
-rw-r--r-- | src/cmd/gotest/gotest.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/gotest/gotest.go b/src/cmd/gotest/gotest.go index b03e79f00a..d5752e76ed 100644 --- a/src/cmd/gotest/gotest.go +++ b/src/cmd/gotest/gotest.go @@ -153,8 +153,12 @@ func setEnvironment() { if gc == "" { gc = O + "g" } - XGC = []string{gc, "-I", "_test", "-o", "_xtest_." + O} - GC = []string{gc, "-I", "_test", "_testmain.go"} + var gcflags []string + if gf := strings.TrimSpace(os.Getenv("GCFLAGS")); gf != "" { + gcflags = strings.Fields(gf) + } + XGC = append([]string{gc, "-I", "_test", "-o", "_xtest_." + O}, gcflags...) + GC = append(append([]string{gc, "-I", "_test"}, gcflags...), "_testmain.go") gl := os.Getenv("GL") if gl == "" { gl = O + "l" |