"os"
"os/exec"
"path/filepath"
+ "runtime"
"strings"
"sync"
"testing"
}
androiddir = fmt.Sprintf("/data/local/tmp/testcshared-%d", os.Getpid())
- if GOOS == "android" {
+ if runtime.GOOS != GOOS && GOOS == "android" {
args := append(adbCmd(), "exec-out", "mkdir", "-p", androiddir)
cmd := exec.Command(args[0], args[1:]...)
out, err := cmd.CombinedOutput()
}
func adbPush(t *testing.T, filename string) {
- if GOOS != "android" {
+ if runtime.GOOS == GOOS || GOOS != "android" {
return
}
args := append(adbCmd(), "push", filename, fmt.Sprintf("%s/%s", androiddir, filename))
func runExe(t *testing.T, extraEnv []string, args ...string) string {
t.Helper()
- if GOOS == "android" {
+ if runtime.GOOS != GOOS && GOOS == "android" {
return adbRun(t, append(os.Environ(), extraEnv...), args...)
}
return run(t, extraEnv, args...)
return fmt.Errorf("command failed: %v\n%v\n%s\n", args, err, out)
}
- if GOOS == "android" {
+ if runtime.GOOS != GOOS && GOOS == "android" {
args = append(adbCmd(), "push", libgoname, fmt.Sprintf("%s/%s", androiddir, libgoname))
cmd = exec.Command(args[0], args[1:]...)
out, err = cmd.CombinedOutput()