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 | 4edb3dabb1e2fc677ed3b5c6da7338c8ce728804 (patch) | |
tree | ad37814b66768a83116ef1ab9180de51e93c46ec | |
parent | 3834af742c4174c474acf7937d067ad51b62131f (diff) | |
download | go-4edb3dabb1e2fc677ed3b5c6da7338c8ce728804.tar.gz |
gotest: use $GCFLAGS like make does
R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/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 b03e79f00..d5752e76e 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" |