From 00530918db29102a0186bcf2b3e699a742d298fa Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 8 Apr 2019 15:45:16 +0200 Subject: [PATCH] misc/cgo/testcshared: use adb exec-out instead of adb shell Adb exec-out is like adb shell except non-flaky in non-interactive settings. Don't ask why. Change-Id: I7ac3c72912883d80bc787c1d0fc101db6bae9c52 Reviewed-on: https://go-review.googlesource.com/c/go/+/170952 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- misc/cgo/testcshared/cshared_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index 8c4c3c7e57..8dac639042 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -46,7 +46,7 @@ func testMain(m *testing.M) int { androiddir = fmt.Sprintf("/data/local/tmp/testcshared-%d", os.Getpid()) if GOOS == "android" { - args := append(adbCmd(), "shell", "mkdir", "-p", androiddir) + args := append(adbCmd(), "exec-out", "mkdir", "-p", androiddir) cmd := exec.Command(args[0], args[1:]...) out, err := cmd.CombinedOutput() if err != nil { @@ -191,7 +191,7 @@ func adbRun(t *testing.T, env []string, adbargs ...string) string { if GOOS != "android" { t.Fatalf("trying to run adb command when operating system is not android.") } - args := append(adbCmd(), "shell") + args := append(adbCmd(), "exec-out") // Propagate LD_LIBRARY_PATH to the adb shell invocation. for _, e := range env { if strings.Index(e, "LD_LIBRARY_PATH=") != -1 { @@ -298,7 +298,7 @@ func cleanupAndroid() { if GOOS != "android" { return } - args := append(adbCmd(), "shell", "rm", "-rf", androiddir) + args := append(adbCmd(), "exec-out", "rm", "-rf", androiddir) cmd := exec.Command(args[0], args[1:]...) out, err := cmd.CombinedOutput() if err != nil { -- 2.50.0