From a2a8a0468a40e1c0be861c4d47bda8388bc3402e Mon Sep 17 00:00:00 2001 From: Daniel Theophanes Date: Thu, 9 Apr 2015 21:11:16 -0700 Subject: [PATCH] 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 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/cmd/internal/obj/x86/obj6_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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