Add -interpreter to run-test to test interpreter only mode.

Change-Id: I0addb26d22d3e7d486b40119ad35639dd15b9d53
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index 5201928..5c9d9ed 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -6,6 +6,7 @@
 # Options:
 #   --quiet       -- don't chatter
 #   --debug       -- wait for debugger to attach
+#   --interpreter -- enable interpreter only mode (off by default)
 #   --no-verify   -- turn off verification (on by default)
 #   --no-optimize -- turn off optimization (on by default)
 
@@ -17,6 +18,7 @@
 
 DEBUG="n"
 GDB="n"
+INTERPRETER="n"
 VERIFY="y"
 OPTIMIZE="y"
 INVOKE_WITH=""
@@ -44,6 +46,9 @@
     elif [ "x$1" = "x--dev" ]; then
         DEV_MODE="y"
         shift
+    elif [ "x$1" = "x--interpreter" ]; then
+        INTERPRETER="y"
+        shift
     elif [ "x$1" = "x--no-verify" ]; then
         VERIFY="n"
         shift
@@ -92,9 +97,13 @@
     gdbargs="--args $exe"
 fi
 
+if [ "$INTERPRETER" = "y" ]; then
+    INT_OPTS="-Xint"
+fi
+
 JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni"
 
 cd $ANDROID_BUILD_TOP
 $INVOKE_WITH $gdb $exe $gdbargs -Ximage:$ANDROID_ROOT/framework/core.art \
-    $JNI_OPTS $DEBUG_OPTS \
+    $JNI_OPTS $INT_OPTS $DEBUG_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 47d8c32..7154ac2 100755
--- a/test/etc/push-and-run-test-jar
+++ b/test/etc/push-and-run-test-jar
@@ -8,6 +8,7 @@
 #   --debug       -- wait for debugger to attach
 #   --zygote      -- use the zygote (if so, all other options are ignored)
 #   --dev         -- development mode (print the vm invocation cmdline)
+#   --interpreter -- enable interpreter only mode (off by default)
 #   --no-verify   -- turn off verification (on by default)
 #   --no-optimize -- turn off optimization (on by default)
 #   --no-precise  -- turn off precise GC (on by default)
@@ -21,6 +22,7 @@
 
 OATEXEC="oatexecd"
 DEBUG="n"
+INTERPRETER="n"
 VERIFY="y"
 OPTIMIZE="y"
 ZYGOTE=""
@@ -45,6 +47,9 @@
     elif [ "x$1" = "x--dev" ]; then
         DEV_MODE="y"
         shift
+    elif [ "x$1" = "x--interpreter" ]; then
+        INTERPRETER="y"
+        shift
     elif [ "x$1" = "x--invoke-with" ]; then
         shift
         INVOKE_WITH="$1"
@@ -114,10 +119,14 @@
   DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
 fi
 
+if [ "$INTERPRETER" = "y" ]; then
+    INT_OPTS="-Xint"
+fi
+
 JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni"
 
 cmdline="cd $DEX_LOCATION && mkdir art-cache && export ANDROID_DATA=$DEX_LOCATION && export DEX_LOCATION=$DEX_LOCATION && \
-    $INVOKE_WITH $OATEXEC $ZYGOTE $JNI_OPTS $DEBUG_OPTS -Ximage:/data/art-test/core.art -cp $DEX_LOCATION/$TEST_NAME.jar Main"
+    $INVOKE_WITH $OATEXEC $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUG_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-all-tests b/test/run-all-tests
index 3176f02..a6675df 100755
--- a/test/run-all-tests
+++ b/test/run-all-tests
@@ -49,6 +49,9 @@
     elif [ "x$1" = "x--zygote" ]; then
         run_args="${run_args} --zygote"
         shift
+    elif [ "x$1" = "x--interpreter" ]; then
+        run_args="${run_args} --interpreter"
+        shift
     elif [ "x$1" = "x--no-verify" ]; then
         run_args="${run_args} --no-verify"
         shift
@@ -84,8 +87,8 @@
         echo "  $prog [options]  Run all tests with the given options."
         echo "  Options are all passed to run-test; refer to that for " \
              "further documentation:"
-        echo "    --debug --dev --host --jvm --no-optimize --no-verify"
-        echo "    -O --update --valgrind --zygote"
+        echo "    --debug --dev --host --interpreter --jvm --no-optimize"
+        echo "    --no-verify -O --update --valgrind --zygote"
     ) 1>&2
     exit 1
 fi
diff --git a/test/run-test b/test/run-test
index 795c521..9095dd3 100755
--- a/test/run-test
+++ b/test/run-test
@@ -85,6 +85,9 @@
     elif [ "x$1" = "x--zygote" ]; then
         run_args="${run_args} --zygote"
         shift
+    elif [ "x$1" = "x--interpreter" ]; then
+        run_args="${run_args} --interpreter"
+        shift
     elif [ "x$1" = "x--no-verify" ]; then
         run_args="${run_args} --no-verify"
         shift
@@ -167,6 +170,7 @@
         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)."
+        echo "    --interpreter  Enable interpreter only mode (off by default)."
         echo "    --no-verify    Turn off verification (on by default)."
         echo "    --no-optimize  Turn off optimization (on by default)."
         echo "    --no-precise   Turn off precise GC (on by default)."