]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testcshared: use adb exec-out instead of adb shell
authorElias Naur <mail@eliasnaur.com>
Mon, 8 Apr 2019 13:45:16 +0000 (15:45 +0200)
committerElias Naur <mail@eliasnaur.com>
Mon, 8 Apr 2019 18:21:14 +0000 (18:21 +0000)
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 <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testcshared/cshared_test.go

index 8c4c3c7e579b9b76e4bb9dbfa558c74f8181d33b..8dac639042e90b8329eea91599834601d87ed2a1 100644 (file)
@@ -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 {