aboutsummaryrefslogtreecommitdiff
path: root/src/path
diff options
context:
space:
mode:
authorRemi Gillig <remigillig@gmail.com>2017-02-11 17:34:48 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2017-02-11 19:53:56 +0000
commit2ceeb7b090464a8da421f72e19267869b86b0901 (patch)
tree22e02ee6f798c8293c3a01c39d889eeb36f903a1 /src/path
parent60d7d247a1a5d96152061aa9cfeb5466b90a6787 (diff)
downloadgo-2ceeb7b090464a8da421f72e19267869b86b0901.tar.xz
path/filepath: fix TestWinSplitListTestsAreValid on some systems
The environment variables used in those tests override the default OS ones. However, one of them (SystemRoot) seems to be required on some Windows systems for invoking cmd.exe properly. This fixes #4930 and #6568. Change-Id: I23dfb67c1de86020711a3b59513f6adcbba12561 Reviewed-on: https://go-review.googlesource.com/36873 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/path')
-rw-r--r--src/path/filepath/path_windows_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go
index 73e74be8d3..c9a0255efd 100644
--- a/src/path/filepath/path_windows_test.go
+++ b/src/path/filepath/path_windows_test.go
@@ -67,6 +67,9 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
}
}
+ // on some systems, SystemRoot is required for cmd to work
+ systemRoot := os.Getenv("SystemRoot")
+
for i, d := range tt.result {
if d == "" {
continue
@@ -75,7 +78,7 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
cmd := &exec.Cmd{
Path: comspec,
Args: []string{`/c`, cmdfile},
- Env: []string{`Path=` + tt.list},
+ Env: []string{`Path=` + tt.list, `SystemRoot=` + systemRoot},
Dir: tmp,
}
out, err := cmd.CombinedOutput()