From: Alex Brainman Date: Fri, 18 Aug 2017 06:34:44 +0000 (+1000) Subject: misc/cgo/testcshared: cd into work directory before running android command X-Git-Tag: go1.10beta1~1449 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e2cdec77c6aed0838631289bce5c17bbfe7c4dfc;p=gostls13.git misc/cgo/testcshared: cd into work directory before running android command Hopefully this will fix android build. Maybe fixes #21513 Change-Id: I98f760562646f06b56e385c36927e79458465b92 Reviewed-on: https://go-review.googlesource.com/56790 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index 47dd0c69af..57649a0bfb 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -151,7 +151,8 @@ func adbRun(t *testing.T, adbargs ...string) string { t.Fatalf("trying to run adb command when operating system is not android.") } args := []string{"adb", "shell"} - args = append(args, adbargs...) + shellcmd := fmt.Sprintf("cd %s; %s", androiddir, strings.Join(adbargs, " ")) + args = append(args, shellcmd) cmd := exec.Command(args[0], args[1:]...) out, err := cmd.CombinedOutput() if err != nil {