Add --invoke-with and -d to the dalvik tests.

Change-Id: I358945fd2b41c1615441c1687a582a66e662eba9
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index ea20da5..1fba19d 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -6,7 +6,6 @@
 # Options:
 #   --quiet       -- don't chatter
 #   --debug       -- wait for debugger to attach
-#   --valgrind    -- use valgrind
 #   --no-verify   -- turn off verification (on by default)
 #   --no-optimize -- turn off optimization (on by default)
 
@@ -20,7 +19,7 @@
 GDB="n"
 VERIFY="y"
 OPTIMIZE="y"
-VALGRIND="n"
+INVOKE_WITH=""
 DEV_MODE="n"
 QUIET="n"
 
@@ -34,8 +33,9 @@
     elif [ "x$1" = "x--gdb" ]; then
         GDB="y"
         shift
-    elif [ "x$1" = "x--valgrind" ]; then
-        VALGRIND="y"
+    elif [ "x$1" = "x--invoke-with" ]; then
+        shift
+        INVOKE_WITH="$1"
         shift
     elif [ "x$1" = "x--dev" ]; then
         DEV_MODE="y"
@@ -50,7 +50,7 @@
         shift
         break
     elif expr "x$1" : "x--" >/dev/null 2>&1; then
-        echo "unknown option: $1" 1>&2
+        echo "unknown $0 option: $1" 1>&2
         exit 1
     else
         break
@@ -77,14 +77,6 @@
     msg "Skipping verification"
 fi
 
-if [ "$VALGRIND" = "y" ]; then
-    msg "Running with valgrind"
-    valgrind_cmd="valgrind"
-    #valgrind_cmd="valgrind --leak-check=full"
-else
-    valgrind_cmd=""
-fi
-
 msg "------------------------------"
 
 HOSTBASE="${ANDROID_BUILD_TOP}/out/host"
@@ -123,6 +115,6 @@
     gdbargs="--args $exe"
 fi
 
-$valgrind_cmd $gdb $exe $gdbargs "-Xbootclasspath:${bpath}" \
+$INVOKE_WITH $gdb $exe $gdbargs "-Xbootclasspath:${bpath}" \
     $DEX_VERIFY $DEX_OPTIMIZE $DEX_DEBUG -ea \
     -cp test.jar Main "$@"