aboutsummaryrefslogtreecommitdiff
path: root/src/androidtest.bash
diff options
context:
space:
mode:
authorHyang-Ah Hana Kim <hyangah@gmail.com>2015-10-21 13:50:06 -0400
committerHyang-Ah Hana Kim <hyangah@gmail.com>2015-10-21 19:34:27 +0000
commit2e47b28ea165eb3aeb2db0eee173e930fb7f7bca (patch)
tree59907afcc9cd87af0c189983475254fa0b26ff53 /src/androidtest.bash
parent73f329f47236c6952235db395802810156a7bd65 (diff)
downloadgo-2e47b28ea165eb3aeb2db0eee173e930fb7f7bca.tar.xz
androidtest.bash: correct the location of compiled packages
For android, gc builds with buildmode=pie by default, and as a result, the compiled packages are not installed in the usual pkg/$GOOS_$GOARCH pack. Copy the compiled packages in pkg/android_$GOARCH_shared into the pkg/android_$GOARCH in the test device. Change-Id: I909e4cc7095ac95ef63bdf6ddc4cb2c698f3459e Reviewed-on: https://go-review.googlesource.com/16151 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/androidtest.bash')
-rwxr-xr-xsrc/androidtest.bash11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/androidtest.bash b/src/androidtest.bash
index 0010738614..326bce6608 100755
--- a/src/androidtest.bash
+++ b/src/androidtest.bash
@@ -56,7 +56,16 @@ mkdir -p $FAKE_GOROOT/pkg
cp -a "${GOROOT}/src" "${FAKE_GOROOT}/"
cp -a "${GOROOT}/test" "${FAKE_GOROOT}/"
cp -a "${GOROOT}/lib" "${FAKE_GOROOT}/"
-cp -a "${GOROOT}/pkg/android_$GOARCH" "${FAKE_GOROOT}/pkg/"
+
+# For android, the go tool will install the compiled package in
+# pkg/android_${GOARCH}_shared directory by default, not in
+# the usual pkg/${GOOS}_${GOARCH}. Some tests in src/go/* assume
+# the compiled packages were installed in the usual places.
+# Instead of reflecting this exception into the go/* packages,
+# we copy the compiled packages into the usual places.
+cp -a "${GOROOT}/pkg/android_${GOARCH}_shared" "${FAKE_GOROOT}/pkg/"
+mv "${FAKE_GOROOT}/pkg/android_${GOARCH}_shared" "${FAKE_GOROOT}/pkg/android_${GOARCH}"
+
echo '# Syncing test files to android device'
adb shell mkdir -p /data/local/tmp/goroot
time adb sync data &> /dev/null