summaryrefslogtreecommitdiff
path: root/test/run.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-03-07 02:22:08 -0500
committerRuss Cox <rsc@golang.org>2012-03-07 02:22:08 -0500
commitb1bcdb785e3253e4e49a42cb6b497d7576b215f1 (patch)
treeb07469acf0a8fa1c0f36c9c9931dd933087f03f9 /test/run.go
parenta0779e4d93783fba471554a8de6f352ffbb9b820 (diff)
downloadgo-b1bcdb785e3253e4e49a42cb6b497d7576b215f1.tar.gz
test/run: fix builders
Let the outer environment filter down to the commands being run. TBR=r CC=golang-dev http://codereview.appspot.com/5758066
Diffstat (limited to 'test/run.go')
-rw-r--r--test/run.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/run.go b/test/run.go
index 34ff57b74..c9c78b568 100644
--- a/test/run.go
+++ b/test/run.go
@@ -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
}