]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix TestScript/mod_gobuild_import on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Sun, 29 Jul 2018 11:15:25 +0000 (13:15 +0200)
committerDavid du Colombier <0intro@gmail.com>
Sun, 29 Jul 2018 15:42:29 +0000 (15:42 +0000)
CL 125296 added TestScript/mod_gobuild_import. This
test is failing on Plan 9, because go/build invokes
the go tool which cannot be found in the path.

The "PATH" environment variable has been updated to
contain the path to the go tool on Unix and Windows,
but on Plan 9, the analogous environment variable is
called "path".

This change fixes the script engine by setting
the "path" environment variable on Plan 9.

Fixes #26669.

Change-Id: If1be50e14baceccee591f4f76b7e698f5e12a2d4
Reviewed-on: https://go-review.googlesource.com/126608
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/script_test.go

index 263e26fa352606dadc8698f4fb52665f6c655581..90cf3a5679e85baafd4ff60cd32cc61aad36ebf1 100644 (file)
@@ -98,6 +98,10 @@ func (ts *testScript) setup() {
                ":=" + string(os.PathListSeparator),
        }
 
+       if runtime.GOOS == "plan9" {
+               ts.env = append(ts.env, "path="+testBin+string(filepath.ListSeparator)+os.Getenv("path"))
+       }
+
        if runtime.GOOS == "windows" {
                ts.env = append(ts.env, "exe=.exe")
        } else {