Skip to content

Commit b064eb7

Browse files
committed
cmd/go: update go_windows_test to use test go binary
Most of the cmd/go tests build the cmd/go binary and run that binary to test it, but TestAbsolutePath used the GOROOT's cmd/go instead, which makes debugging confusing and means that make.bash has to be run in each iteration cycle. Update TestAbsolutePath to use the same go binary as the rest of the cmd/go tests. Change-Id: Ib4e8ae707b66f1f75ceb346b98358f5604fd28c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/256979 Trust: Michael Matloob <[email protected]> Run-TryBot: Michael Matloob <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 9f24388 commit b064eb7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cmd/go/go_windows_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
package main
5+
package main_test
66

77
import (
8-
"internal/testenv"
98
"io/ioutil"
109
"os"
1110
"os/exec"
@@ -17,7 +16,9 @@ import (
1716
)
1817

1918
func TestAbsolutePath(t *testing.T) {
20-
t.Parallel()
19+
tg := testgo(t)
20+
defer tg.cleanup()
21+
tg.parallel()
2122

2223
tmp, err := ioutil.TempDir("", "TestAbsolutePath")
2324
if err != nil {
@@ -38,7 +39,7 @@ func TestAbsolutePath(t *testing.T) {
3839

3940
noVolume := file[len(filepath.VolumeName(file)):]
4041
wrongPath := filepath.Join(dir, noVolume)
41-
cmd := exec.Command(testenv.GoToolPath(t), "build", noVolume)
42+
cmd := exec.Command(tg.goTool(), "build", noVolume)
4243
cmd.Dir = dir
4344
output, err := cmd.CombinedOutput()
4445
if err == nil {

0 commit comments

Comments
 (0)