Move to new art dalvikvm

Change-Id: Ib04bc9853b7084965fa0c9899c3e5f5ac42d4ce7
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index f8f393f..357fb5a 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -9,7 +9,8 @@
     fi
 }
 
-DEBUG="n"
+LIB="libartd.so"
+DEBUGGER="n"
 GDB="n"
 INTERPRETER="n"
 VERIFY="y"
@@ -17,17 +18,19 @@
 INVOKE_WITH=""
 DEV_MODE="n"
 QUIET="n"
-OATEXEC="oatexecd"
 
 while true; do
     if [ "x$1" = "x--quiet" ]; then
         QUIET="y"
         shift
+    elif [ "x$1" = "x-lib" ]; then
+        shift
+        LIB="$1"
     elif [ "x$1" = "x-O" ]; then
-        OATEXEC="oatexec"
+        LIB="libart.so"
         shift
     elif [ "x$1" = "x--debug" ]; then
-        DEBUG="y"
+        DEBUGGER="y"
         shift
     elif [ "x$1" = "x--gdb" ]; then
         GDB="y"
@@ -81,13 +84,13 @@
 export DYLD_LIBRARY_PATH="${ANDROID_ROOT}/lib"
 unset ANDROID_PRODUCT_OUT # avoid defaulting dex2oat --host-prefix to target output
 
-exe="${ANDROID_ROOT}/bin/${OATEXEC}"
+exe="${ANDROID_ROOT}/bin/dalvikvm"
 
-if [ "$DEBUG" = "y" ]; then
+if [ "$DEBUGGER" = "y" ]; then
     PORT=8000
     msg "Waiting for jdb to connect:"
     msg "    jdb -attach localhost:$PORT"
-    DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
+    DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
 fi
 
 if [ "$GDB" = "y" ]; then
@@ -104,6 +107,6 @@
 JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni"
 
 cd $ANDROID_BUILD_TOP
-$INVOKE_WITH $gdb $exe $gdbargs -Ximage:$ANDROID_ROOT/framework/core.art \
-    $JNI_OPTS $INT_OPTS $DEBUG_OPTS \
+$INVOKE_WITH $gdb $exe $gdbargs -XXlib:$LIB -Ximage:$ANDROID_ROOT/framework/core.art \
+    $JNI_OPTS $INT_OPTS $DEBUGGER_OPTS \
     -cp $DEX_LOCATION/$TEST_NAME.jar Main "$@"
diff --git a/test/etc/push-and-run-test-jar b/test/etc/push-and-run-test-jar
index 1e653e2..cc28592 100755
--- a/test/etc/push-and-run-test-jar
+++ b/test/etc/push-and-run-test-jar
@@ -9,9 +9,9 @@
     fi
 }
 
-OATEXEC="oatexecd"
+LIB="libartd.so"
 GDB="n"
-DEBUG="n"
+DEBUGGER="n"
 INTERPRETER="n"
 VERIFY="y"
 OPTIMIZE="y"
@@ -24,11 +24,14 @@
     if [ "x$1" = "x--quiet" ]; then
         QUIET="y"
         shift
+    elif [ "x$1" = "x-lib" ]; then
+        shift
+        LIB="$1"
     elif [ "x$1" = "x-O" ]; then
-        OATEXEC="oatexec"
+        LIB="libart.so"
         shift
     elif [ "x$1" = "x--debug" ]; then
-        DEBUG="y"
+        DEBUGGER="y"
         shift
     elif [ "x$1" = "x--gdb" ]; then
         GDB="y"
@@ -105,16 +108,16 @@
   adb push $TEST_NAME-ex.jar $DEX_LOCATION >/dev/null 2>&1
 fi
 
-if [ "$DEBUG" = "y" ]; then
+if [ "$DEBUGGER" = "y" ]; then
   # Use this instead for ddms and connect by running 'ddms':
-  # DEBUG_OPTS="-agentlib:jdwp=transport=dt_android_adb,server=y,suspend=y"
+  # DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_android_adb,server=y,suspend=y"
   # TODO: add a separate --ddms option?
 
   PORT=12345
   msg "Waiting for jdb to connect:"
   msg "    adb forward tcp:$PORT tcp:$PORT"
   msg "    jdb -attach localhost:$PORT"
-  DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
+  DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
 fi
 
 if [ "$GDB" = "y" ]; then
@@ -129,7 +132,7 @@
 JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni"
 
 cmdline="cd $DEX_LOCATION && mkdir dalvik-cache && export ANDROID_DATA=$DEX_LOCATION && export DEX_LOCATION=$DEX_LOCATION && \
-    $INVOKE_WITH $gdb $OATEXEC $gdbargs $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUG_OPTS -Ximage:/data/art-test/core.art -cp $DEX_LOCATION/$TEST_NAME.jar Main"
+    $INVOKE_WITH $gdb dalvikvm $gdbargs -XXlib:$LIB $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUGGER_OPTS -Ximage:/data/art-test/core.art -cp $DEX_LOCATION/$TEST_NAME.jar Main"
 if [ "$DEV_MODE" = "y" ]; then
   echo $cmdline "$@"
 fi
diff --git a/test/run-test b/test/run-test
index b4db141..4744f19 100755
--- a/test/run-test
+++ b/test/run-test
@@ -172,7 +172,7 @@
         echo '  Omitting the test name or specifying "-" will use the' \
              "current directory."
         echo "  Runtime Options:"
-        echo "    -O             Run oatexec rather than oatexecd (off by default)."
+        echo "    -O             Run non-debug rather than debug build (off by default)."
         echo "    --debug        Wait for a debugger to attach."
         echo "    --gdb          Run under gdb; incompatible with some tests."
         echo "    --build-only   Build test files only (off by default)."