mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
all: use GOROOT/bin/go instead of go for tests
Using 'go' command in tests is confusing when using a different version of Go (e.g., go1.13rc1). Use GOROOT/bin/go so that the same Go is used. Change-Id: I0ca297207acc5e7fd8b291f544302f6c7b0d38e1 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/191517 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
@@ -37,12 +37,13 @@ func testMain(m *testing.M) int {
|
||||
exe = ".exe"
|
||||
}
|
||||
if runtime.GOOS != "android" {
|
||||
gocmd := filepath.Join(runtime.GOROOT(), "bin", "go")
|
||||
gomobileBin = filepath.Join(binDir, "gomobile"+exe)
|
||||
gobindBin := filepath.Join(binDir, "gobind"+exe)
|
||||
if out, err := exec.Command("go", "build", "-o", gomobileBin, "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
|
||||
if out, err := exec.Command(gocmd, "build", "-o", gomobileBin, "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
|
||||
log.Fatalf("gomobile build failed: %v: %s", err, out)
|
||||
}
|
||||
if out, err := exec.Command("go", "build", "-o", gobindBin, "golang.org/x/mobile/cmd/gobind").CombinedOutput(); err != nil {
|
||||
if out, err := exec.Command(gocmd, "build", "-o", gobindBin, "golang.org/x/mobile/cmd/gobind").CombinedOutput(); err != nil {
|
||||
log.Fatalf("gobind build failed: %v: %s", err, out)
|
||||
}
|
||||
PATH := os.Getenv("PATH")
|
||||
|
||||
Reference in New Issue
Block a user