1
0
mirror of https://github.com/golang/go synced 2024-11-20 09:34:52 -07:00

gotest: use $GCFLAGS like make does

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5297044
This commit is contained in:
Russ Cox 2011-10-19 13:10:23 -04:00
parent bb8c4ed22a
commit 35b2bfc8da

View File

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