]> Cypherpunks repositories - gostls13.git/commitdiff
build: androidtest.bash has to use copy for files to adb-sync.
authorHyang-Ah Hana Kim <hyangah@gmail.com>
Wed, 14 Jan 2015 17:13:17 +0000 (12:13 -0500)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Thu, 15 Jan 2015 13:53:03 +0000 (13:53 +0000)
androidtest.bash copies some go source to the android device
where the tests are going to run. It's necessary because some
tests require files and resources to be present. The copy is
done through adb sync. The script hoped faking the directory
using symlinks to work, but it doesn't. (adb sync doesn't follow
the symlinks) We need proper copy.

Change-Id: If55abca4958f159859e58512b0045f23654167e3
Reviewed-on: https://go-review.googlesource.com/2827
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/androidtest.bash

index b250cf4a781080229ef4835bc5389a24b7907971..4968a00f6e9224820b32bd6823a676fd2cfafc5c 100755 (executable)
@@ -38,14 +38,15 @@ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \
 #
 # The adb sync command will sync either the /system or /data
 # directories of an android device from a similar directory
-# on the host. So we fake one with symlinks to push the GOROOT
-# into a subdirectory of /data.
+# on the host. We copy the files required for running tests under
+# /data/local/tmp/goroot. The adb sync command does not follow
+# symlinks so we have to copy.
 export ANDROID_PRODUCT_OUT=/tmp/androidtest-$$
 FAKE_GOROOT=$ANDROID_PRODUCT_OUT/data/local/tmp/goroot
 mkdir -p $FAKE_GOROOT
-ln -s $GOROOT/src $FAKE_GOROOT/src
-ln -s $GOROOT/test $FAKE_GOROOT/test
-ln -s $GOROOT/lib $FAKE_GOROOT/lib
+cp -R --preserve=all "${GOROOT}/src" "${FAKE_GOROOT}/"
+cp -R --preserve=all "${GOROOT}/test" "${FAKE_GOROOT}/"
+cp -R --preserve=all "${GOROOT}/lib" "${FAKE_GOROOT}/"
 echo '# Syncing test files to android device'
 time adb sync data &> /dev/null
 echo ''