]> Cypherpunks repositories - gostls13.git/commitdiff
misc/android: copy testdata directories to device before running
authorElias Naur <mail@eliasnaur.com>
Mon, 25 Feb 2019 10:18:03 +0000 (11:18 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 26 Feb 2019 18:01:15 +0000 (18:01 +0000)
We've got away with not copying the testdata directories for the
standard library because the exec wrapper also pushes almost the
entire $GOROOT tree to the device, including testdata directories.

Similar to what the iOS exec wrapper does.

Change-Id: I91ef63ef84a658fc8843002890132c64b7c1d20e
Reviewed-on: https://go-review.googlesource.com/c/163626
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/android/go_android_exec.go

index 0055fb832af763777db66c2a724aca81930c0ae0..fa84f00f67b821a47d7ca1ce3bba6bc318bffc2d 100644 (file)
@@ -95,6 +95,7 @@ func main() {
        } else {
                adbSyncGoroot()
        }
+       run("shell", "mkdir", "-p", deviceCwd)
 
        // Binary names can conflict.
        // E.g. template.test from the {html,text}/template packages.
@@ -102,6 +103,10 @@ func main() {
        deviceBin := fmt.Sprintf("%s/%s", deviceGotmp, binName)
        run("push", os.Args[1], deviceBin)
 
+       if _, err := os.Stat("testdata"); err == nil {
+               run("push", "testdata", deviceCwd)
+       }
+
        // Forward SIGQUIT from the go command to show backtraces from
        // the binary instead of from this wrapper.
        quit := make(chan os.Signal, 1)