Revert^2 "Add jvm mode to run-libcore-tests.sh"

This reverts commit 58a7d6c890e5e8b9de55c49a5b23cc518ddaeebe.

Test: art/tools/run-libcore-tests.sh --mode=jvm -- libcore.java.lang.invoke
Test: Compare output using --dry-run with arguments from buildbots.
Change-Id: Ic051d4c4467c59f5bdc79a6af9923993e7dbaf49
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index 31bd600..7050b0f 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -64,7 +64,7 @@
   Run libcore tests using the vogar testing tool.
 
   Required parameters:
-    --mode=device|host     Specify where tests should be run.
+    --mode=device|host|jvm Specify where tests should be run.
 
   Optional parameters:
     --debug                Use debug version of ART (device|host only).
@@ -178,7 +178,7 @@
 # Run tests that use the getrandom() syscall? (Requires Linux 3.17+).
 getrandom=true
 
-# Execution mode specifies where to run tests (device|host).
+# Execution mode specifies where to run tests (device|host|jvm).
 execution_mode=""
 
 # Default expectations file.
@@ -203,6 +203,10 @@
       vogar_args="$vogar_args $1 --vm-arg -Ximage:/non/existent/vogar.art"
       execution_mode="host"
       ;;
+    --mode=jvm)
+      vogar_args="$vogar_args $1"
+      execution_mode="jvm"
+      ;;
     --no-getrandom)
       getrandom=false
       ;;
@@ -270,35 +274,37 @@
   fi
 fi  # $execution_mode = "device"
 
-# Add timeout to vogar command-line.
-vogar_args="$vogar_args --timeout $timeout_secs"
+if [ $execution_mode = "device" -o $execution_mode = "host" ]; then
+  # Add timeout to vogar command-line.
+  vogar_args="$vogar_args --timeout $timeout_secs"
 
-# set the toolchain to use.
-vogar_args="$vogar_args --toolchain d8 --language CUR"
+  # set the toolchain to use.
+  vogar_args="$vogar_args --toolchain d8 --language CUR"
 
-# JIT settings.
-if $use_jit; then
-  vogar_args="$vogar_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken"
-fi
-vogar_args="$vogar_args --vm-arg -Xusejit:$use_jit"
-
-# gcstress may lead to timeouts, so we need dedicated expectations files for it.
-if $gcstress; then
-  expectations="$expectations --expectations art/tools/libcore_gcstress_failures.txt"
-  if $debug; then
-    expectations="$expectations --expectations art/tools/libcore_gcstress_debug_failures.txt"
+  # JIT settings.
+  if $use_jit; then
+    vogar_args="$vogar_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken"
   fi
-else
-  # We only run this package when user has not specified packages
-  # to run and not under gcstress as it can cause timeouts. See
-  # b/78228743.
-  working_packages+=("libcore.libcore.icu")
-fi
+  vogar_args="$vogar_args --vm-arg -Xusejit:$use_jit"
 
-if $getrandom; then :; else
-  # Ignore failures in tests that use the system calls not supported
-  # on fugu (Nexus Player, kernel version Linux 3.10).
-  expectations="$expectations --expectations art/tools/libcore_fugu_failures.txt"
+  # gcstress may lead to timeouts, so we need dedicated expectations files for it.
+  if $gcstress; then
+    expectations="$expectations --expectations art/tools/libcore_gcstress_failures.txt"
+    if $debug; then
+      expectations="$expectations --expectations art/tools/libcore_gcstress_debug_failures.txt"
+    fi
+  else
+    # We only run this package when user has not specified packages
+    # to run and not under gcstress as it can cause timeouts. See
+    # b/78228743.
+    working_packages+=("libcore.libcore.icu")
+  fi
+
+  if $getrandom; then :; else
+    # Ignore failures in tests that use the system calls not supported
+    # on fugu (Nexus Player, kernel version Linux 3.10).
+    expectations="$expectations --expectations art/tools/libcore_fugu_failures.txt"
+  fi
 fi
 
 if [ ! -t 1 ] ; then