OSDN Git Service

Update jdwp and libcore scripts for running with libartd.
authorNicolas Geoffray <ngeoffray@google.com>
Mon, 15 Jun 2015 13:35:01 +0000 (14:35 +0100)
committerNicolas Geoffray <ngeoffray@google.com>
Mon, 15 Jun 2015 14:35:47 +0000 (15:35 +0100)
Also make run-libcore-tests.sh a bit smarter by knowing
some of the arguments it needs to pass to vogar.

bug:21746693

Change-Id: Ib92b5f96ba8f15ff1de5fb387e67b3d14ce233c9

tools/run-jdwp-tests.sh
tools/run-libcore-tests.sh

index 77e8004..7135dba 100755 (executable)
@@ -39,6 +39,7 @@ device_dir="--device-dir=/data/local/tmp"
 # image.
 vm_command="--vm-command=$art"
 image_compiler_option=""
+debug="no"
 
 while true; do
   if [[ "$1" == "--mode=host" ]]; then
@@ -53,12 +54,17 @@ while true; do
     # Vogar knows which VM to use on host.
     vm_command=""
     # We only compile the image on the host. Note that not providing this option
-    # puts us below the adb command limit for vogar.
+    # for target testing puts us below the adb command limit for vogar.
     image_compiler_option="--vm-arg -Ximage-compiler-option --vm-arg --debuggable"
     shift
   elif [[ $1 == -Ximage:* ]]; then
     image="$1"
     shift
+  elif [[ $1 == "--debug" ]]; then
+    debug="yes"
+    # Remove the --debug from the arguments.
+    args=${args/$1}
+    shift
   elif [[ "$1" == "" ]]; then
     break
   else
@@ -66,9 +72,16 @@ while true; do
   fi
 done
 
+vm_args="--vm-arg $image"
+if [[ $debug == "yes" ]]; then
+  art="$art -d"
+  art_debugee="$art_debugee -d"
+  vm_args="$vm_args --vm-arg -XXlib:libartd.so"
+fi
+
 # Run the tests using vogar.
 vogar $vm_command \
-      --vm-arg $image \
+      $vm_args \
       --verbose \
       $args \
       $device_dir \
index 344d2de..c6cbb38 100755 (executable)
@@ -62,7 +62,37 @@ working_packages=("libcore.icu"
                   "tests.java.lang.String"
                   "jsr166")
 
+vogar_args=$@
+while true; do
+  if [[ "$1" == "--mode=device" ]]; then
+    vogar_args="$vogar_args --device-dir=/data/local/tmp"
+    vogar_args="$vogar_args --vm-command=/data/local/tmp/system/bin/art"
+    vogar_args="$vogar_args --vm-arg -Ximage:/data/art-test/core-optimizing.art"
+    shift
+  elif [[ "$1" == "--mode=host" ]]; then
+    # We explicitly give a wrong path for the image, to ensure vogar
+    # will create a boot image with the default compiler. Note that
+    # giving an existing image on host does not work because of
+    # classpath/resources differences when compiling the boot image.
+    vogar_args="$vogar_args --vm-arg -Ximage:/non/existent"
+    shift
+  elif [[ $1 == "--debug" ]]; then
+    # Remove the --debug from the arguments.
+    vogar_args=${vogar_args/$1}
+    vogar_args="$vogar_args --vm-arg -XXlib:libartd.so"
+    # Increase the timeout, as vogar cannot set individual test
+    # timeout when being asked to run packages, and some tests go above
+    # the default timeout.
+    vogar_args="$vogar_args --timeout 180"
+    shift
+  elif [[ "$1" == "" ]]; then
+    break
+  else
+    shift
+  fi
+done
+
 # Run the tests using vogar.
 echo "Running tests for the following test packages:"
 echo ${working_packages[@]} | tr " " "\n"
-vogar $@ --expectations art/tools/libcore_failures.txt --classpath $jsr166_test_jar --classpath $test_jar ${working_packages[@]}
+vogar $vogar_args --expectations art/tools/libcore_failures.txt --classpath $jsr166_test_jar --classpath $test_jar ${working_packages[@]}