aboutsummaryrefslogtreecommitdiff
path: root/src/androidtest.bash
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2016-08-28 09:03:08 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2016-08-29 15:24:39 +0000
commit26124030a051b6b05a29349fdc4b92880e18c8a8 (patch)
treec05d471052edf64662218aa0701d98107c2125ae /src/androidtest.bash
parent6dd0b2d70292fc57e5664e2806f1d46cd621f531 (diff)
downloadgo-26124030a051b6b05a29349fdc4b92880e18c8a8.tar.xz
androidtest.bash: use go list to get pkg dir
This will be more robust in the faces of future changes to the pkg dir layout. Change-Id: Iaf078093f02ef3a10884a19c25e2068cbbf5f36a Reviewed-on: https://go-review.googlesource.com/27929 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/androidtest.bash')
-rwxr-xr-xsrc/androidtest.bash8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/androidtest.bash b/src/androidtest.bash
index c76882d9db..3ac56d1745 100755
--- a/src/androidtest.bash
+++ b/src/androidtest.bash
@@ -47,6 +47,12 @@ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \
-o ../bin/go_android_${GOARCH}_exec \
../misc/android/go_android_exec.go
+export pkgdir=$(dirname $(go list -f '{{.Target}}' runtime))
+if [ "$pkgdir" = "" ]; then
+ echo "could not find android pkg dir" 1>&2
+ exit 1
+fi
+
export ANDROID_TEST_DIR=/tmp/androidtest-$$
function cleanup() {
@@ -68,7 +74,7 @@ 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/"
+cp -a "${pkgdir}" "${FAKE_GOROOT}/pkg/"
echo '# Syncing test files to android device'
adb shell mkdir -p /data/local/tmp/goroot