Fix run-test on host.
Change-Id: I44ebb4cdc2f5966be51a063e3c7256ab3016c404
diff --git a/test/003-omnibus-opcodes/build b/test/003-omnibus-opcodes/build
index 0671a32..bb9c4f8 100644
--- a/test/003-omnibus-opcodes/build
+++ b/test/003-omnibus-opcodes/build
@@ -24,4 +24,4 @@
dx -JXmx256m --debug --dex --dump-to=classes.lst --output=classes.dex classes
zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
diff --git a/test/022-interface/build b/test/022-interface/build
index 24b32bb..1841f0622d 100644
--- a/test/022-interface/build
+++ b/test/022-interface/build
@@ -21,4 +21,4 @@
# issue when interfaces override methods in Object
dx --debug --dex --dump-to=classes.lst --output=classes.dex classes
zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
diff --git a/test/023-many-interfaces/build b/test/023-many-interfaces/build
index b28ab88..5d981f4 100644
--- a/test/023-many-interfaces/build
+++ b/test/023-many-interfaces/build
@@ -26,4 +26,4 @@
dx --debug --dex --dump-to=classes.lst --output=classes.dex classes
zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
diff --git a/test/056-const-string-jumbo/build b/test/056-const-string-jumbo/build
index d052831..b3d9aad 100644
--- a/test/056-const-string-jumbo/build
+++ b/test/056-const-string-jumbo/build
@@ -44,4 +44,4 @@
dx -JXmx500m --debug --dex --no-optimize --positions=none --no-locals --dump-to=classes.lst --output=classes.dex classes
zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
diff --git a/test/085-old-style-inner-class/build b/test/085-old-style-inner-class/build
index daf615d..b771e6c 100644
--- a/test/085-old-style-inner-class/build
+++ b/test/085-old-style-inner-class/build
@@ -26,4 +26,4 @@
dx --debug --dex --dump-to=classes.lst --output=classes.dex --dump-width=1000 classes 2>/dev/null
zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
diff --git a/test/etc/default-build b/test/etc/default-build
index 3e5ccd3..01bac6b 100755
--- a/test/etc/default-build
+++ b/test/etc/default-build
@@ -26,7 +26,8 @@
dx -JXmx256m --debug --dex --dump-to=classes.lst --output=classes.dex --dump-width=1000 classes
zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
if [ -r src-ex ]; then
mkdir classes-ex
@@ -37,7 +38,7 @@
mv classes.dex classes-1.dex
mv classes-ex.dex classes.dex
zip $TEST_NAME-ex.jar classes.dex
- dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME-ex.jar --dex-location=/data/run-test/$TEST_NAME-ex.jar --oat-file=$TEST_NAME-ex.jar.oat
+ dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME-ex.jar --dex-location=$DEX_LOCATION/$TEST_NAME-ex.jar --oat-file=$TEST_NAME-ex.jar.oat $DEX2OAT_ARGS
mv classes.dex classes-ex.dex
mv classes-1.dex classes.dex
fi
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index f424487..b56549e 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -61,7 +61,7 @@
HOSTBASE="${ANDROID_BUILD_TOP}/out/host"
DATA_DIR=/tmp
-DEBUG_OPTS="-Xcheck:jni -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
+DEBUG_OPTS="-Xcheck:jni"
if [ ! -d $DATA_DIR/art-cache ]; then
mkdir -p $DATA_DIR/art-cache
@@ -84,7 +84,10 @@
if [ "$DEBUG" = "y" ]; then
PORT=8000
msg "Waiting for debugger to connect on localhost:$PORT"
- DEX_DEBUG="-agentlib:jdwp=transport=dt_socket,addres=$PORT,server=y,suspend=y"
+ # This is for jdb:
+ DEX_DEBUG="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
+ # Connect thus:
+ # jdb -attach localhost:12345
fi
if [ "$GDB" = "y" ]; then
@@ -94,5 +97,5 @@
cd $ANDROID_BUILD_TOP
$INVOKE_WITH $gdb $exe $gdbargs -Ximage:$ANDROID_ROOT/framework/core.art \
- $DEX_DEBUG ${DEBUG_OPTS} \
- -cp test.jar Main "$@"
+ $DEBUG_OPTS $DEX_DEBUG -verbose:log-to=$DEX_LOCATION/log.txt\
+ -cp $DEX_LOCATION/$TEST_NAME.jar Main "$@"
diff --git a/test/run-all-tests b/test/run-all-tests
index 18ffa17..3176f02 100755
--- a/test/run-all-tests
+++ b/test/run-all-tests
@@ -103,15 +103,19 @@
# wait for all the tests, collecting the failures
failure_count=0
+succeeded_count=0
failed_test_names=""
for pid in ${test_pids[@]}; do
wait $pid
if [ "$?" != "0" ]; then
let failure_count+=1
- failed_test_names="$failed_test_names $test_names[$pid]"
+ failed_test_names="$failed_test_names ${test_names[$pid]}[pid=$pid]"
+ else
+ let succeeded_count+=1
fi
done
+echo "succeeded tests: $succeeded_count"
echo "failed tests: $failure_count"
for i in $failed_test_names; do
diff --git a/test/run-test b/test/run-test
index 0c31c31..c3170b6 100755
--- a/test/run-test
+++ b/test/run-test
@@ -32,10 +32,14 @@
cd "${progdir}"
progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
+tmp_dir="/tmp/test-$$"
export JAVA="java"
export JAVAC="javac -g -target 1.5"
export RUN="${progdir}/etc/push-and-run-test-jar"
+export IMAGE=${ANDROID_PRODUCT_OUT}/data/art-test/core.art
+export DEX_LOCATION=/data/run-test
+export DEX2OAT_ARGS=""
info="info.txt"
build="build"
@@ -53,6 +57,9 @@
while true; do
if [ "x$1" = "x--host" ]; then
RUN="${progdir}/etc/host-run-test-jar"
+ IMAGE=${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/core.art
+ DEX_LOCATION=$tmp_dir
+ DEX2OAT_ARGS="--instruction-set=X86 --host-prefix=$ANDROID_BUILD_TOP/"
shift
elif [ "x$1" = "x--jvm" ]; then
RUN="${progdir}/etc/reference-run-test-classes"
@@ -164,8 +171,6 @@
td_info="${test_dir}/${info}"
td_expected="${test_dir}/${expected}"
-tmp_dir="/tmp/test-$$"
-
if [ '!' '(' -r "$td_info" -a -r "$td_expected" ')' ]; then
echo "${test_dir}: missing files" 1>&2
exit 1