aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Theophanes <kardianos@gmail.com>2015-04-09 21:11:16 -0700
committerIan Lance Taylor <iant@golang.org>2015-04-10 04:57:00 +0000
commita2a8a0468a40e1c0be861c4d47bda8388bc3402e (patch)
treef17628db52222824eb55e1604be034564ba881de /src
parentfae4a128cb5570c6caccf4b4f2b92d118db1c775 (diff)
downloadgo-a2a8a0468a40e1c0be861c4d47bda8388bc3402e.tar.xz
cmd/internal/obj/x86: look for go cmd in GOBIN if present.
If GOBIN is not empty the build moves the go executable to a new path. When this test runs it fails to find the go cmd in the GOROOT. Change-Id: I100def0fbcb9691b13776f795b1d1725e36d8102 Reviewed-on: https://go-review.googlesource.com/8735 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/internal/obj/x86/obj6_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/x86/obj6_test.go b/src/cmd/internal/obj/x86/obj6_test.go
index 93f8f3c262..7b64fe962b 100644
--- a/src/cmd/internal/obj/x86/obj6_test.go
+++ b/src/cmd/internal/obj/x86/obj6_test.go
@@ -97,8 +97,13 @@ func asmOutput(t *testing.T, s string) []byte {
if err != nil {
t.Fatal(err)
}
+ gofolder := filepath.Join(build.Default.GOROOT, "bin")
+ if gobin := os.Getenv("GOBIN"); len(gobin) != 0 {
+ gofolder = gobin
+ }
+
cmd := exec.Command(
- build.Default.GOROOT+"/bin/go", "tool", "asm", "-S", "-dynlink",
+ filepath.Join(gofolder, "go"), "tool", "asm", "-S", "-dynlink",
"-o", filepath.Join(tmpdir, "output.6"), tmpfile.Name())
var env []string