aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/lp_windows_test.go
diff options
context:
space:
mode:
authorLubomir I. Ivanov (VMware) <neolit123@gmail.com>2018-04-25 20:57:19 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2018-04-26 18:25:25 +0000
commit353bba37df54adcefde7faf41edc34d2bfa5f978 (patch)
tree7cd31a11e69104c3d186f948cf1d0f6fdb00461d /src/os/exec/lp_windows_test.go
parent0d54fb5610fb054e08a77f2a68a4df145182ae8e (diff)
downloadgo-353bba37df54adcefde7faf41edc34d2bfa5f978.tar.gz
go-353bba37df54adcefde7faf41edc34d2bfa5f978.zip
os/exec: fix Win32 tests missing 'chcp'
'%SystemRoot%/System32/chcp.com' is a tool on Windows that is used to change the active code page in the console. 'go test os/exec' can fail with: "'chcp' is not recognized as an internal or external command" The test uses a custom PATH variable but does not include '%SystemRoot%/System32'. Always append that to PATH. Updates #24709 Change-Id: I1ab83b326072e3f0086b391b836234bcfd8a1fb7 GitHub-Last-Rev: fb930529bb0673cdec921df5a2821c4b41de745e GitHub-Pull-Request: golang/go#25088 Reviewed-on: https://go-review.googlesource.com/109361 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/os/exec/lp_windows_test.go')
-rw-r--r--src/os/exec/lp_windows_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/exec/lp_windows_test.go b/src/os/exec/lp_windows_test.go
index d1c9046174..64d7dca2e8 100644
--- a/src/os/exec/lp_windows_test.go
+++ b/src/os/exec/lp_windows_test.go
@@ -117,7 +117,7 @@ func createEnv(dir, PATH, PATHEXT string) []string {
dirs[i] = filepath.Join(dir, dirs[i])
}
path := strings.Join(dirs, ";")
- env = updateEnv(env, "PATH", path)
+ env = updateEnv(env, "PATH", os.Getenv("SystemRoot") + "/System32;" + path)
return env
}