diff options
| author | Keith Randall <khr@golang.org> | 2016-08-30 11:08:47 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2016-08-30 22:49:11 +0000 |
| commit | 842b05832fb5088a212e30962f58c95a38296d32 (patch) | |
| tree | 7454308e3546c1f3cd8ba9901ec282aa453b1645 /src/debug | |
| parent | be23e98e06b1e1c65de19d460537c4df21ebf555 (diff) | |
| download | go-842b05832fb5088a212e30962f58c95a38296d32.tar.xz | |
all: use testing.GoToolPath instead of "go"
This change makes sure that tests are run with the correct
version of the go tool. The correct version is the one that
we invoked with "go test", not the one that is first in our path.
Fixes #16577
Change-Id: If22c8f8c3ec9e7c35d094362873819f2fbb8559b
Reviewed-on: https://go-review.googlesource.com/28089
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/gosym/pclntab_test.go | 4 | ||||
| -rw-r--r-- | src/debug/pe/file_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go index 9f82e31ae4..7e7cee6793 100644 --- a/src/debug/gosym/pclntab_test.go +++ b/src/debug/gosym/pclntab_test.go @@ -37,7 +37,7 @@ func dotest(t *testing.T) { // the resulting binary looks like it was built from pclinetest.s, // but we have renamed it to keep it away from the go tool. pclinetestBinary = filepath.Join(pclineTempDir, "pclinetest") - cmd := exec.Command("go", "tool", "asm", "-o", pclinetestBinary+".o", "pclinetest.asm") + cmd := exec.Command(testenv.GoToolPath(t), "tool", "asm", "-o", pclinetestBinary+".o", "pclinetest.asm") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { @@ -58,7 +58,7 @@ func dotest(t *testing.T) { t.Fatal(err) } - cmd = exec.Command("go", "tool", "link", "-H", "linux", + cmd = exec.Command(testenv.GoToolPath(t), "tool", "link", "-H", "linux", "-o", pclinetestBinary, pclinetestBinary+".o") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go index 964caf56ec..5a740c8705 100644 --- a/src/debug/pe/file_test.go +++ b/src/debug/pe/file_test.go @@ -307,7 +307,7 @@ func main() { src := filepath.Join(tmpdir, "a.go") exe := filepath.Join(tmpdir, "a.exe") err = ioutil.WriteFile(src, []byte(prog), 0644) - output, err := exec.Command("go", "build", "-o", exe, src).CombinedOutput() + output, err := exec.Command(testenv.GoToolPath(t), "build", "-o", exe, src).CombinedOutput() if err != nil { t.Fatalf("building test executable failed: %s %s", err, output) } |
