Fix armv8 testing with default ANDROID_ROOT.
Change-Id: I68ac57240783822972a3f49dd54de01ef60e637d
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 39f28c8..9ecc885 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -305,6 +305,14 @@
adb push $TEST_NAME-ex.jar $DEX_LOCATION >/dev/null 2>&1
fi
+ LD_LIBRARY_PATH=
+ if [ "$ANDROID_ROOT" != "/system" ]; then
+ # Current default installation is dalvikvm 64bits and dex2oat 32bits,
+ # so we can only use LD_LIBRARY_PATH when testing on a local
+ # installation.
+ LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBRARY_DIRECTORY
+ fi
+
# Create a script with the command. The command can get longer than the longest
# allowed adb command and there is no way to get the exit status from a adb shell
# command.
@@ -312,7 +320,7 @@
export ANDROID_DATA=$DEX_LOCATION && \
export DEX_LOCATION=$DEX_LOCATION && \
export ANDROID_ROOT=$ANDROID_ROOT && \
- export LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBRARY_DIRECTORY && \
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH && \
$mkdir_cmdline && \
$dex2oat_cmdline && \
$dalvikvm_cmdline"