Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2015 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | if [ ! -d libcore ]; then |
| 18 | echo "Script needs to be run at the root of the android tree" |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
Roland Levillain | 3dfaab0 | 2018-04-03 15:34:40 +0100 | [diff] [blame] | 22 | # Prevent JDWP tests from running on the following devices running |
| 23 | # Android O (they are failing because of a network-related issue), as |
| 24 | # a workaround for b/74725685: |
| 25 | # - FA7BN1A04406 (walleye device testing configuration aosp-poison/volantis-armv7-poison-debug) |
| 26 | # - FA7BN1A04412 (walleye device testing configuration aosp-poison/volantis-armv8-poison-ndebug) |
| 27 | # - FA7BN1A04433 (walleye device testing configuration aosp-poison/volantis-armv8-poison-debug) |
| 28 | case "$ANDROID_SERIAL" in |
| 29 | (FA7BN1A04406|FA7BN1A04412|FA7BN1A04433) exit 0;; |
| 30 | esac |
| 31 | |
Colin Cross | e0ef0a8 | 2017-07-27 21:29:18 +0000 | [diff] [blame] | 32 | source build/envsetup.sh >&/dev/null # for get_build_var, setpaths |
| 33 | setpaths # include platform prebuilt java, javac, etc in $PATH. |
Shubham Ajmera | c33c087 | 2017-07-20 18:41:52 -0700 | [diff] [blame] | 34 | |
Andreas Gampe | ebd089d | 2016-07-18 14:56:56 -0700 | [diff] [blame] | 35 | if [ -z "$ANDROID_HOST_OUT" ] ; then |
| 36 | ANDROID_HOST_OUT=${OUT_DIR-$ANDROID_BUILD_TOP/out}/host/linux-x86 |
| 37 | fi |
| 38 | |
Roland Levillain | 08f7c1d | 2018-05-25 15:34:41 +0100 | [diff] [blame^] | 39 | # "Root" (actually "system") directory on device (in the case of |
| 40 | # target testing). |
| 41 | android_root=${ART_TEST_ANDROID_ROOT:-/system} |
Roland Levillain | 1c36188 | 2018-03-02 14:23:51 +0000 | [diff] [blame] | 42 | |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 43 | java_lib_location="${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES" |
| 44 | make_target_name="apache-harmony-jdwp-tests-hostdex" |
Igor Murashkin | 84f2632 | 2017-06-06 11:36:33 -0700 | [diff] [blame] | 45 | |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 46 | vm_args="" |
Roland Levillain | 1c36188 | 2018-03-02 14:23:51 +0000 | [diff] [blame] | 47 | art="$android_root/bin/art" |
| 48 | art_debugee="sh $android_root/bin/art" |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 49 | args=$@ |
Roland Levillain | 08f7c1d | 2018-05-25 15:34:41 +0100 | [diff] [blame^] | 50 | chroot_option= |
Nicolas Geoffray | d553b43 | 2015-07-13 14:35:17 +0100 | [diff] [blame] | 51 | debuggee_args="-Xcompiler-option --debuggable" |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 52 | device_dir="--device-dir=/data/local/tmp" |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame] | 53 | # We use the art script on target to ensure the runner and the debuggee share the same |
| 54 | # image. |
| 55 | vm_command="--vm-command=$art" |
Nicolas Geoffray | a2c1861 | 2015-03-30 23:01:28 +0100 | [diff] [blame] | 56 | image_compiler_option="" |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 57 | plugin="" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 58 | debug="no" |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 59 | explicit_debug="no" |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 60 | verbose="no" |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 61 | image="-Ximage:/data/art-test/core.art" |
Alex Light | 0ac2e5c | 2017-09-19 15:35:20 -0700 | [diff] [blame] | 62 | with_jdwp_path="" |
| 63 | agent_wrapper="" |
Nicolas Geoffray | 9518655 | 2015-10-28 13:06:21 +0000 | [diff] [blame] | 64 | vm_args="" |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 65 | # By default, we run the whole JDWP test suite. |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 66 | has_specific_test="no" |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 67 | test="org.apache.harmony.jpda.tests.share.AllTests" |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 68 | mode="target" |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 69 | # Use JIT compiling by default. |
| 70 | use_jit=true |
Andreas Gampe | 85b286b | 2015-12-30 19:37:48 -0800 | [diff] [blame] | 71 | variant_cmdline_parameter="--variant=X32" |
Alex Light | 878f33f | 2018-02-08 11:16:39 -0800 | [diff] [blame] | 72 | dump_command="/bin/true" |
Sebastien Hertz | c3b208c | 2017-03-27 11:35:54 +0200 | [diff] [blame] | 73 | # Timeout of JDWP test in ms. |
| 74 | # |
| 75 | # Note: some tests expect a timeout to check that *no* reply/event is received for a specific case. |
| 76 | # A lower timeout can save up several minutes when running the whole test suite, especially for |
| 77 | # continuous testing. This value can be adjusted to fit the configuration of the host machine(s). |
| 78 | jdwp_test_timeout=10000 |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 79 | |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 80 | gdb_target= |
| 81 | has_gdb="no" |
| 82 | |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 83 | while true; do |
| 84 | if [[ "$1" == "--mode=host" ]]; then |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 85 | mode="host" |
Nicolas Geoffray | 5978690 | 2015-03-30 16:34:16 +0100 | [diff] [blame] | 86 | # Specify bash explicitly since the art script cannot, since it has to run on the device |
| 87 | # with mksh. |
Alex Light | b15fea2 | 2015-09-17 16:59:09 -0700 | [diff] [blame] | 88 | art="bash ${OUT_DIR-out}/host/linux-x86/bin/art" |
| 89 | art_debugee="bash ${OUT_DIR-out}/host/linux-x86/bin/art" |
Andreas Gampe | 8994a04 | 2015-12-30 19:03:17 +0000 | [diff] [blame] | 90 | # We force generation of a new image to avoid build-time and run-time classpath differences. |
| 91 | image="-Ximage:/system/non/existent/vogar.art" |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame] | 92 | # We do not need a device directory on host. |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 93 | device_dir="" |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame] | 94 | # Vogar knows which VM to use on host. |
| 95 | vm_command="" |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 96 | shift |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 97 | elif [[ "$1" == "--mode=jvm" ]]; then |
| 98 | mode="ri" |
| 99 | make_target_name="apache-harmony-jdwp-tests-host" |
| 100 | art="$(which java)" |
| 101 | art_debugee="$(which java)" |
| 102 | # No need for extra args. |
| 103 | debuggee_args="" |
| 104 | # No image. On the RI. |
| 105 | image="" |
| 106 | # We do not need a device directory on RI. |
| 107 | device_dir="" |
| 108 | # Vogar knows which VM to use on RI. |
| 109 | vm_command="" |
| 110 | # We don't care about jit with the RI |
| 111 | use_jit=false |
| 112 | shift |
Alex Light | ec4a10c | 2017-11-17 09:06:26 -0800 | [diff] [blame] | 113 | elif [[ $1 == --test-timeout-ms ]]; then |
| 114 | # Remove the --test-timeout-ms from the arguments. |
| 115 | args=${args/$1} |
| 116 | shift |
| 117 | jdwp_test_timeout=$1 |
| 118 | # Remove the argument |
| 119 | args=${args/$1} |
| 120 | shift |
Alex Light | 0ac2e5c | 2017-09-19 15:35:20 -0700 | [diff] [blame] | 121 | elif [[ $1 == --agent-wrapper ]]; then |
| 122 | # Remove the --agent-wrapper from the arguments. |
| 123 | args=${args/$1} |
| 124 | shift |
| 125 | agent_wrapper=${agent_wrapper}${1}, |
| 126 | # Remove the argument |
| 127 | args=${args/$1} |
| 128 | shift |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 129 | elif [[ $1 == -Ximage:* ]]; then |
| 130 | image="$1" |
| 131 | shift |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 132 | elif [[ "$1" == "--no-jit" ]]; then |
| 133 | use_jit=false |
| 134 | # Remove the --no-jit from the arguments. |
| 135 | args=${args/$1} |
| 136 | shift |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 137 | elif [[ $1 == "--no-debug" ]]; then |
| 138 | explicit_debug="yes" |
| 139 | debug="no" |
| 140 | # Remove the --no-debug from the arguments. |
| 141 | args=${args/$1} |
| 142 | shift |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 143 | elif [[ $1 == "--debug" ]]; then |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 144 | explicit_debug="yes" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 145 | debug="yes" |
| 146 | # Remove the --debug from the arguments. |
| 147 | args=${args/$1} |
| 148 | shift |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 149 | elif [[ $1 == "--verbose" ]]; then |
| 150 | verbose="yes" |
| 151 | # Remove the --verbose from the arguments. |
| 152 | args=${args/$1} |
| 153 | shift |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 154 | elif [[ $1 == "--gdbserver" ]]; then |
| 155 | # Remove the --gdbserver from the arguments. |
| 156 | args=${args/$1} |
| 157 | has_gdb="yes" |
| 158 | shift |
| 159 | gdb_target=$1 |
| 160 | # Remove the target from the arguments. |
| 161 | args=${args/$1} |
| 162 | shift |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 163 | elif [[ $1 == "--test" ]]; then |
| 164 | # Remove the --test from the arguments. |
| 165 | args=${args/$1} |
| 166 | shift |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 167 | has_specific_test="yes" |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 168 | test=$1 |
| 169 | # Remove the test from the arguments. |
| 170 | args=${args/$1} |
| 171 | shift |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 172 | elif [[ "$1" == "--jdwp-path" ]]; then |
| 173 | # Remove the --jdwp-path from the arguments. |
| 174 | args=${args/$1} |
| 175 | shift |
Alex Light | 0ac2e5c | 2017-09-19 15:35:20 -0700 | [diff] [blame] | 176 | with_jdwp_path=$1 |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 177 | # Remove the path from the arguments. |
| 178 | args=${args/$1} |
| 179 | shift |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 180 | elif [[ "$1" == "" ]]; then |
| 181 | break |
Andreas Gampe | 85b286b | 2015-12-30 19:37:48 -0800 | [diff] [blame] | 182 | elif [[ $1 == --variant=* ]]; then |
| 183 | variant_cmdline_parameter=$1 |
| 184 | shift |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 185 | elif [[ $1 == -Xplugin:* ]]; then |
| 186 | plugin="$1" |
| 187 | args=${args/$1} |
| 188 | shift |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 189 | else |
| 190 | shift |
| 191 | fi |
| 192 | done |
| 193 | |
Roland Levillain | 08f7c1d | 2018-05-25 15:34:41 +0100 | [diff] [blame^] | 194 | if [[ $mode == "target" ]]; then |
| 195 | # Honor environment variable ART_TEST_CHROOT. |
| 196 | if [[ -n "$ART_TEST_CHROOT" ]]; then |
| 197 | # Set Vogar's `--chroot` option. |
| 198 | chroot_option="--chroot $ART_TEST_CHROOT" |
| 199 | # Adjust settings for chroot environment. |
| 200 | art="/system/bin/art" |
| 201 | art_debugee="sh /system/bin/art" |
| 202 | vm_command="--vm-command=$art" |
| 203 | device_dir="--device-dir=/tmp" |
| 204 | fi |
Roland Levillain | e4f1c51 | 2017-10-30 13:28:28 +0000 | [diff] [blame] | 205 | fi |
| 206 | |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 207 | if [[ $has_gdb = "yes" ]]; then |
| 208 | if [[ $explicit_debug = "no" ]]; then |
| 209 | debug="yes" |
| 210 | fi |
| 211 | fi |
| 212 | |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 213 | if [[ $mode == "ri" ]]; then |
Alex Light | 0ac2e5c | 2017-09-19 15:35:20 -0700 | [diff] [blame] | 214 | if [[ "x$with_jdwp_path" != "x" ]]; then |
| 215 | vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentArgument=-agentpath:${agent_wrapper}" |
| 216 | vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentName=$with_jdwp_path" |
| 217 | fi |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 218 | if [[ "x$image" != "x" ]]; then |
| 219 | echo "Cannot use -Ximage: with --mode=jvm" |
| 220 | exit 1 |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 221 | elif [[ $has_gdb = "yes" ]]; then |
| 222 | echo "Cannot use --gdbserver with --mode=jvm" |
| 223 | exit 1 |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 224 | elif [[ $debug == "yes" ]]; then |
| 225 | echo "Cannot use --debug with --mode=jvm" |
| 226 | exit 1 |
| 227 | fi |
| 228 | else |
Alex Light | 878f33f | 2018-02-08 11:16:39 -0800 | [diff] [blame] | 229 | if [[ "$mode" == "host" ]]; then |
| 230 | dump_command="/bin/kill -3" |
| 231 | else |
Roland Levillain | b52dbb7 | 2018-05-01 14:03:45 +0100 | [diff] [blame] | 232 | # Note that this dumping command won't work when `$android_root` |
| 233 | # is different from `/system` (e.g. on ART Buildbot devices) when |
| 234 | # the device is running Android N, as the debuggerd protocol |
| 235 | # changed in an incompatible way in Android O (see b/32466479). |
| 236 | dump_command="$android_root/xbin/su root $android_root/bin/debuggerd" |
Alex Light | 878f33f | 2018-02-08 11:16:39 -0800 | [diff] [blame] | 237 | fi |
Alex Light | 84b92e0 | 2017-09-29 13:46:14 -0700 | [diff] [blame] | 238 | if [[ $has_gdb = "yes" ]]; then |
| 239 | if [[ $mode == "target" ]]; then |
| 240 | echo "Cannot use --gdbserver with --mode=target" |
| 241 | exit 1 |
| 242 | else |
| 243 | art_debugee="$art_debugee --gdbserver $gdb_target" |
| 244 | # The tests absolutely require some timeout. We set a ~2 week timeout since we can kill the |
| 245 | # test with gdb if it goes on too long. |
| 246 | jdwp_test_timeout="1000000000" |
| 247 | fi |
| 248 | fi |
Alex Light | 0ac2e5c | 2017-09-19 15:35:20 -0700 | [diff] [blame] | 249 | if [[ "x$with_jdwp_path" != "x" ]]; then |
| 250 | vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentArgument=-agentpath:${agent_wrapper}" |
| 251 | vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentName=${with_jdwp_path}" |
| 252 | fi |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 253 | vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --debuggable" |
| 254 | # Make sure the debuggee doesn't clean up what the debugger has generated. |
| 255 | art_debugee="$art_debugee --no-clean" |
| 256 | fi |
| 257 | |
| 258 | function jlib_name { |
| 259 | local path=$1 |
| 260 | local str="classes" |
| 261 | local suffix="jar" |
| 262 | if [[ $mode == "ri" ]]; then |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 263 | str="javalib" |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 264 | fi |
| 265 | echo "$path/$str.$suffix" |
| 266 | } |
| 267 | |
| 268 | # Jar containing all the tests. |
| 269 | test_jar=$(jlib_name "${java_lib_location}/${make_target_name}_intermediates") |
| 270 | |
| 271 | if [[ ! -f $test_jar ]]; then |
| 272 | echo "Before running, you must build jdwp tests and vogar:" \ |
| 273 | "make ${make_target_name} vogar" |
| 274 | exit 1 |
| 275 | fi |
Nicolas Geoffray | c0c0785 | 2017-08-08 09:44:15 +0100 | [diff] [blame] | 276 | |
Andreas Gampe | 85b286b | 2015-12-30 19:37:48 -0800 | [diff] [blame] | 277 | # For the host: |
| 278 | # |
| 279 | # If, on the other hand, there is a variant set, use it to modify the art_debugee parameter to |
| 280 | # force the fork to have the same bitness as the controller. This should be fine and not impact |
| 281 | # testing (cross-bitness), as the protocol is always 64-bit anyways (our implementation). |
| 282 | # |
| 283 | # Note: this isn't necessary for the device as the BOOTCLASSPATH environment variable is set there |
| 284 | # and used as a fallback. |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 285 | if [[ $mode == "host" ]]; then |
Andreas Gampe | 85b286b | 2015-12-30 19:37:48 -0800 | [diff] [blame] | 286 | variant=${variant_cmdline_parameter:10} |
| 287 | if [[ $variant == "x32" || $variant == "X32" ]]; then |
| 288 | art_debugee="$art_debugee --32" |
| 289 | elif [[ $variant == "x64" || $variant == "X64" ]]; then |
| 290 | art_debugee="$art_debugee --64" |
| 291 | else |
| 292 | echo "Error, do not understand variant $variant_cmdline_parameter." |
| 293 | exit 1 |
| 294 | fi |
| 295 | fi |
| 296 | |
Nicolas Geoffray | 9518655 | 2015-10-28 13:06:21 +0000 | [diff] [blame] | 297 | if [[ "$image" != "" ]]; then |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 298 | vm_args="$vm_args --vm-arg $image" |
Nicolas Geoffray | 9518655 | 2015-10-28 13:06:21 +0000 | [diff] [blame] | 299 | fi |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 300 | |
| 301 | if [[ "$plugin" != "" ]]; then |
| 302 | vm_args="$vm_args --vm-arg $plugin" |
| 303 | fi |
| 304 | |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 305 | if $use_jit; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 306 | vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken" |
| 307 | debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken" |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 308 | fi |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 309 | |
| 310 | if [[ $mode != "ri" ]]; then |
| 311 | vm_args="$vm_args --vm-arg -Xusejit:$use_jit" |
| 312 | debuggee_args="$debuggee_args -Xusejit:$use_jit" |
| 313 | fi |
| 314 | |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 315 | if [[ $debug == "yes" ]]; then |
| 316 | art="$art -d" |
| 317 | art_debugee="$art_debugee -d" |
Andreas Gampe | 1c5b42f | 2017-06-15 18:20:45 -0700 | [diff] [blame] | 318 | vm_args="$vm_args --vm-arg -XXlib:libartd.so --vm-arg -XX:SlowDebug=true" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 319 | fi |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 320 | if [[ $verbose == "yes" ]]; then |
| 321 | # Enable JDWP logs in the debuggee. |
| 322 | art_debugee="$art_debugee -verbose:jdwp" |
| 323 | fi |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 324 | |
Neil Fuller | 239bdf6 | 2018-01-08 18:55:36 +0000 | [diff] [blame] | 325 | if [[ $mode != "ri" ]]; then |
Neil Fuller | c546ec9 | 2018-01-05 15:00:35 +0000 | [diff] [blame] | 326 | toolchain_args="--toolchain d8 --language CUR" |
Alex Light | 264a486 | 2018-01-31 16:47:58 +0000 | [diff] [blame] | 327 | if [[ "x$with_jdwp_path" == "x" ]]; then |
| 328 | # Need to enable the internal jdwp implementation. |
| 329 | art_debugee="${art_debugee} -XjdwpProvider:internal" |
| 330 | fi |
Alex Light | 8d8299d | 2017-11-10 08:41:04 -0800 | [diff] [blame] | 331 | else |
| 332 | toolchain_args="--toolchain javac --language CUR" |
Igor Murashkin | 84f2632 | 2017-06-06 11:36:33 -0700 | [diff] [blame] | 333 | fi |
| 334 | |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 335 | # Run the tests using vogar. |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame] | 336 | vogar $vm_command \ |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 337 | $vm_args \ |
Nicolas Geoffray | 9620b9d | 2015-03-30 12:28:26 +0100 | [diff] [blame] | 338 | --verbose \ |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 339 | $args \ |
Roland Levillain | 08f7c1d | 2018-05-25 15:34:41 +0100 | [diff] [blame^] | 340 | $chroot_option \ |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 341 | $device_dir \ |
Nicolas Geoffray | a2c1861 | 2015-03-30 23:01:28 +0100 | [diff] [blame] | 342 | $image_compiler_option \ |
Nicolas Geoffray | 472b00c | 2015-05-06 14:57:09 +0100 | [diff] [blame] | 343 | --timeout 800 \ |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 344 | --vm-arg -Djpda.settings.verbose=true \ |
Sebastien Hertz | c3b208c | 2017-03-27 11:35:54 +0200 | [diff] [blame] | 345 | --vm-arg -Djpda.settings.timeout=$jdwp_test_timeout \ |
| 346 | --vm-arg -Djpda.settings.waitingTime=$jdwp_test_timeout \ |
Nicolas Geoffray | a2c1861 | 2015-03-30 23:01:28 +0100 | [diff] [blame] | 347 | --vm-arg -Djpda.settings.transportAddress=127.0.0.1:55107 \ |
Alex Light | 878f33f | 2018-02-08 11:16:39 -0800 | [diff] [blame] | 348 | --vm-arg -Djpda.settings.dumpProcess="$dump_command" \ |
Alex Light | 617c9c5 | 2017-08-18 11:52:25 -0700 | [diff] [blame] | 349 | --vm-arg -Djpda.settings.debuggeeJavaPath="$art_debugee $plugin $image $debuggee_args" \ |
Igor Murashkin | 84f2632 | 2017-06-06 11:36:33 -0700 | [diff] [blame] | 350 | --classpath "$test_jar" \ |
| 351 | $toolchain_args \ |
Sebastien Hertz | a646aaf | 2015-09-10 12:03:51 +0200 | [diff] [blame] | 352 | $test |
Hiroshi Yamauchi | a166bbb | 2015-11-19 16:24:31 -0800 | [diff] [blame] | 353 | |
| 354 | vogar_exit_status=$? |
| 355 | |
| 356 | echo "Killing stalled dalvikvm processes..." |
Alex Light | c611ffa | 2017-10-18 08:59:16 -0700 | [diff] [blame] | 357 | if [[ $mode == "host" ]]; then |
Hiroshi Yamauchi | a166bbb | 2015-11-19 16:24:31 -0800 | [diff] [blame] | 358 | pkill -9 -f /bin/dalvikvm |
| 359 | else |
Orion Hodson | cfb4ed5 | 2018-05-22 10:48:52 +0100 | [diff] [blame] | 360 | # Tests may run on older Android versions where pkill requires "-l SIGNAL" |
| 361 | # rather than "-SIGNAL". |
| 362 | adb shell pkill -l 9 -f /bin/dalvikvm |
Hiroshi Yamauchi | a166bbb | 2015-11-19 16:24:31 -0800 | [diff] [blame] | 363 | fi |
| 364 | echo "Done." |
| 365 | |
| 366 | exit $vogar_exit_status |