diff options
| author | David Crawshaw <crawshaw@golang.org> | 2016-03-21 14:41:16 -0400 |
|---|---|---|
| committer | David Crawshaw <crawshaw@golang.org> | 2016-03-22 02:02:23 +0000 |
| commit | d37d3bdcfc429168adac5bf046172fd9c07bfdc2 (patch) | |
| tree | 6e9b5dc2d5273e73f4c536be1e98a5e4372308ce /src/net/http/http_test.go | |
| parent | 596949c18a29c51fcfa3ec2596cae72241e256e1 (diff) | |
| download | go-d37d3bdcfc429168adac5bf046172fd9c07bfdc2.tar.xz | |
net/http, internal/testenv: find go binary in PATH
Fixes #14901
Change-Id: Ia32e09767374a341c9a36c5d977d47d7d1a82315
Reviewed-on: https://go-review.googlesource.com/20967
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/net/http/http_test.go')
| -rw-r--r-- | src/net/http/http_test.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/net/http/http_test.go b/src/net/http/http_test.go index 7fd3181f6f..34da4bbb59 100644 --- a/src/net/http/http_test.go +++ b/src/net/http/http_test.go @@ -10,9 +10,7 @@ import ( "bytes" "internal/testenv" "os/exec" - "path/filepath" "reflect" - "runtime" "testing" ) @@ -67,16 +65,10 @@ func TestCleanHost(t *testing.T) { // This catches accidental dependencies between the HTTP transport and // server code. func TestCmdGoNoHTTPServer(t *testing.T) { - testenv.MustHaveGoBuild(t) - var exeSuffix string - if runtime.GOOS == "windows" { - exeSuffix = ".exe" - } - - goBin := filepath.Join(runtime.GOROOT(), "bin", "go"+exeSuffix) - out, err := exec.Command("go", "tool", "nm", goBin).Output() + goBin := testenv.GoToolPath(t) + out, err := exec.Command("go", "tool", "nm", goBin).CombinedOutput() if err != nil { - t.Fatalf("go tool nm: %v", err) + t.Fatalf("go tool nm: %v: %s", err, out) } wantSym := map[string]bool{ // Verify these exist: (sanity checking this test) |
