diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rwxr-xr-x | tools/run-jdwp-tests.sh | 112 |
2 files changed, 89 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore index 4e806c6514..803c297b07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ JIT_ART **/__pycache__/** +**/.idea +**/*.iml +**/*.pyc +**/*.swn diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh index 355646b713..0b2d65471b 100755 --- a/tools/run-jdwp-tests.sh +++ b/tools/run-jdwp-tests.sh @@ -28,24 +28,10 @@ fi using_jack=$(get_build_var ANDROID_COMPILE_WITH_JACK) -function jlib_suffix { - local str=$1 - local suffix="jar" - if [[ $using_jack == "true" ]]; then - suffix="jack" - fi - echo "$str.$suffix" -} - -# Jar containing all the tests. -test_jar=$(jlib_suffix "${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/apache-harmony-jdwp-tests-hostdex_intermediates/classes") - -if [ ! -f $test_jar ]; then - echo "Before running, you must build jdwp tests and vogar:" \ - "make apache-harmony-jdwp-tests-hostdex vogar" - exit 1 -fi +java_lib_location="${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES" +make_target_name="apache-harmony-jdwp-tests-hostdex" +vm_args="" art="/data/local/tmp/system/bin/art" art_debugee="sh /data/local/tmp/system/bin/art" args=$@ @@ -55,13 +41,14 @@ device_dir="--device-dir=/data/local/tmp" # image. vm_command="--vm-command=$art" image_compiler_option="" +plugin="" debug="no" verbose="no" image="-Ximage:/data/art-test/core.art" vm_args="" # By default, we run the whole JDWP test suite. test="org.apache.harmony.jpda.tests.share.AllTests" -host="no" +mode="target" # Use JIT compiling by default. use_jit=true variant_cmdline_parameter="--variant=X32" @@ -74,7 +61,7 @@ jdwp_test_timeout=10000 while true; do if [[ "$1" == "--mode=host" ]]; then - host="yes" + mode="host" # Specify bash explicitly since the art script cannot, since it has to run on the device # with mksh. art="bash ${OUT_DIR-out}/host/linux-x86/bin/art" @@ -86,6 +73,22 @@ while true; do # Vogar knows which VM to use on host. vm_command="" shift + elif [[ "$1" == "--mode=jvm" ]]; then + mode="ri" + make_target_name="apache-harmony-jdwp-tests-host" + art="$(which java)" + art_debugee="$(which java)" + # No need for extra args. + debuggee_args="" + # No image. On the RI. + image="" + # We do not need a device directory on RI. + device_dir="" + # Vogar knows which VM to use on RI. + vm_command="" + # We don't care about jit with the RI + use_jit=false + shift elif [[ $1 == -Ximage:* ]]; then image="$1" shift @@ -112,18 +115,65 @@ while true; do # Remove the test from the arguments. args=${args/$1} shift + elif [[ "$1" == "--jdwp-path" ]]; then + # Remove the --jdwp-path from the arguments. + args=${args/$1} + shift + vm_args="${vm_args} --vm-arg -Djdpa.settings.debuggeeAgentArgument=\"-agentpath:\"" + vm_args="${vm_args} --vm-arg -Djdpa.settings.debuggeeAgentName=\"$1\"" + # Remove the path from the arguments. + args=${args/$1} + shift elif [[ "$1" == "" ]]; then break elif [[ $1 == --variant=* ]]; then variant_cmdline_parameter=$1 shift + elif [[ $1 == -Xplugin:* ]]; then + plugin="$1" + args=${args/$1} + shift else shift fi done -# Make sure the debuggee doesn't clean up what the debugger has generated. -art_debugee="$art_debugee --no-clean" +if [[ $mode == "ri" ]]; then + using_jack="false" + if [[ "x$image" != "x" ]]; then + echo "Cannot use -Ximage: with --mode=jvm" + exit 1 + elif [[ $debug == "yes" ]]; then + echo "Cannot use --debug with --mode=jvm" + exit 1 + fi +else + vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --debuggable" + # Make sure the debuggee doesn't clean up what the debugger has generated. + art_debugee="$art_debugee --no-clean" +fi + +function jlib_name { + local path=$1 + local str="classes" + local suffix="jar" + if [[ $mode == "ri" ]]; then + suffix="jar" + str="javalib" + elif [[ $using_jack == "true" ]]; then + suffix="jack" + fi + echo "$path/$str.$suffix" +} + +# Jar containing all the tests. +test_jar=$(jlib_name "${java_lib_location}/${make_target_name}_intermediates") + +if [[ ! -f $test_jar ]]; then + echo "Before running, you must build jdwp tests and vogar:" \ + "make ${make_target_name} vogar" + exit 1 +fi # For the host: # @@ -133,7 +183,7 @@ art_debugee="$art_debugee --no-clean" # # Note: this isn't necessary for the device as the BOOTCLASSPATH environment variable is set there # and used as a fallback. -if [[ $host == "yes" ]]; then +if [[ $mode == "host" ]]; then variant=${variant_cmdline_parameter:10} if [[ $variant == "x32" || $variant == "X32" ]]; then art_debugee="$art_debugee --32" @@ -146,14 +196,23 @@ if [[ $host == "yes" ]]; then fi if [[ "$image" != "" ]]; then - vm_args="--vm-arg $image" + vm_args="$vm_args --vm-arg $image" fi + +if [[ "$plugin" != "" ]]; then + vm_args="$vm_args --vm-arg $plugin" +fi + if $use_jit; then vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken" debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken" fi -vm_args="$vm_args --vm-arg -Xusejit:$use_jit" -debuggee_args="$debuggee_args -Xusejit:$use_jit" + +if [[ $mode != "ri" ]]; then + vm_args="$vm_args --vm-arg -Xusejit:$use_jit" + debuggee_args="$debuggee_args -Xusejit:$use_jit" +fi + if [[ $debug == "yes" ]]; then art="$art -d" art_debugee="$art_debugee -d" @@ -182,10 +241,9 @@ vogar $vm_command \ --vm-arg -Djpda.settings.timeout=$jdwp_test_timeout \ --vm-arg -Djpda.settings.waitingTime=$jdwp_test_timeout \ --vm-arg -Djpda.settings.transportAddress=127.0.0.1:55107 \ - --vm-arg -Djpda.settings.debuggeeJavaPath="$art_debugee $image $debuggee_args" \ + --vm-arg -Djpda.settings.debuggeeJavaPath="$art_debugee $plugin $image $debuggee_args" \ --classpath "$test_jar" \ $toolchain_args \ - --vm-arg -Xcompiler-option --vm-arg --debuggable \ $test vogar_exit_status=$? |