]> Cypherpunks repositories - gostls13.git/commitdiff
test/run: fix builders
authorRuss Cox <rsc@golang.org>
Wed, 7 Mar 2012 07:22:08 +0000 (02:22 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 7 Mar 2012 07:22:08 +0000 (02:22 -0500)
Let the outer environment filter down to the commands being run.

TBR=r
CC=golang-dev
https://golang.org/cl/5758066

test/run.go

index 34ff57b74d49e3468b68a602d9bb84989a7ce14a..c9c78b5686e89ce58e8c5bc5415eaab5d17c0dd7 100644 (file)
@@ -265,6 +265,10 @@ func (t *test) run() {
        err = ioutil.WriteFile(filepath.Join(t.tempDir, t.gofile), srcBytes, 0644)
        check(err)
        
+       // A few tests (of things like the environment) require these to be set.
+       os.Setenv("GOOS", runtime.GOOS)
+       os.Setenv("GOARCH", runtime.GOARCH)
+
        useTmp := true
        runcmd := func(args ...string) ([]byte, error) {
                cmd := exec.Command(args[0], args[1:]...)
@@ -274,7 +278,6 @@ func (t *test) run() {
                if useTmp {
                        cmd.Dir = t.tempDir
                }
-               cmd.Env = append(cmd.Env, "GOOS="+runtime.GOOS, "GOARCH="+runtime.GOARCH)
                err := cmd.Run()
                return buf.Bytes(), err
        }