]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: update go_windows_test to use test go binary
authorMichael Matloob <matloob@golang.org>
Thu, 24 Sep 2020 15:26:23 +0000 (11:26 -0400)
committerMichael Matloob <matloob@golang.org>
Mon, 5 Oct 2020 17:31:26 +0000 (17:31 +0000)
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 <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/go_windows_test.go

index 3999166ed98c72ecae268e18143c8ff007a501c6..02634f19f5ec52149f912b5485c97e449547d4d5 100644 (file)
@@ -2,10 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package main_test
 
 import (
-       "internal/testenv"
        "io/ioutil"
        "os"
        "os/exec"
@@ -17,7 +16,9 @@ import (
 )
 
 func TestAbsolutePath(t *testing.T) {
-       t.Parallel()
+       tg := testgo(t)
+       defer tg.cleanup()
+       tg.parallel()
 
        tmp, err := ioutil.TempDir("", "TestAbsolutePath")
        if err != nil {
@@ -38,7 +39,7 @@ func TestAbsolutePath(t *testing.T) {
 
        noVolume := file[len(filepath.VolumeName(file)):]
        wrongPath := filepath.Join(dir, noVolume)
-       cmd := exec.Command(testenv.GoToolPath(t), "build", noVolume)
+       cmd := exec.Command(tg.goTool(), "build", noVolume)
        cmd.Dir = dir
        output, err := cmd.CombinedOutput()
        if err == nil {