]> Cypherpunks repositories - gostls13.git/commitdiff
gotest: use $GCFLAGS like make does
authorRuss Cox <rsc@golang.org>
Wed, 19 Oct 2011 17:10:23 +0000 (13:10 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 19 Oct 2011 17:10:23 +0000 (13:10 -0400)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5297044

src/cmd/gotest/gotest.go

index b03e79f00a9cbf907caa16e0ac59158c2bca69b4..d5752e76ed6bead7aca1f1cca84cf92a7247bbe3 100644 (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"