diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2013-08-07 21:07:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-08-07 21:07:45 +0000 |
commit | debdc39707de3686431ab0b9bf9a4d4f3527e0a1 (patch) | |
tree | 74c5e50a1b2e91818cc0c4468aeeeaaab6ee9503 | |
parent | 8856b1b8c8f9cbb6f447bc23ed30b68d2b00693c (diff) | |
parent | d0722199c3b7497f9211924cb5807a564cf5e39c (diff) | |
download | ndk-debdc39707de3686431ab0b9bf9a4d4f3527e0a1.tar.gz |
Merge "Fix llvm-libc++ test driver to accept different adb device"
-rwxr-xr-x | sources/cxx-stl/llvm-libc++/libcxx/test/testit_android | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/test/testit_android b/sources/cxx-stl/llvm-libc++/libcxx/test/testit_android index 880ae442c..7963a35cd 100755 --- a/sources/cxx-stl/llvm-libc++/libcxx/test/testit_android +++ b/sources/cxx-stl/llvm-libc++/libcxx/test/testit_android @@ -220,12 +220,16 @@ if [ -z "$SOURCE_LIB" ] then SOURCE_LIB="-L$LIBCXX_LIBS" fi +if [ -z "$ADB" ] +then + ADB=adb +fi if [ "$DO_STATIC" ]; then # Statically link to ensure the executable can be run easily through ADB LIBS=-lc++_static else - run2 adb push $LIBCXX_LIBS/libc++_shared.so /data/local/tmp 2>/dev/null + run2 $ADB push $LIBCXX_LIBS/libc++_shared.so /data/local/tmp 2>/dev/null if [ $? != 0 ]; then echo "ERROR: Can't push shared libc++ to target device!" exit 1 @@ -258,9 +262,9 @@ adb_shell () { # Run the command, while storing the standard output to CMD_OUT # and appending the exit code as the last line. if [ "$VERBOSE" -gt 2 ]; then - echo "COMMAND: adb shell $@" + echo "COMMAND: $ADB shell $@" fi - adb shell "$@ ; echo \$?" | sed -e 's![[:cntrl:]]!!g' > $CMD_OUT 2>&1 + $ADB shell "$@ ; echo \$?" | sed -e 's![[:cntrl:]]!!g' > $CMD_OUT 2>&1 # Get last line in log, which contains the exit code from the command RET=$(sed -e '$!d' $CMD_OUT) # Get output, which corresponds to everything except the last line @@ -281,7 +285,7 @@ adb_run () { EXECUTABLE_BASENAME=$(basename "$EXECUTABLE") shift TARGET_PATH=/data/local/tmp - run2 adb push $EXECUTABLE $TARGET_PATH/$EXECUTABLE_BASENAME 2>/dev/null && + run2 $ADB push $EXECUTABLE $TARGET_PATH/$EXECUTABLE_BASENAME 2>/dev/null && adb_shell "LD_LIBRARY_PATH=$TARGET_PATH; cd $TARGET_PATH; ./$EXECUTABLE_BASENAME" } |