blob: e8f2c08f6f1b3ca456ffdd2b0092ca672b9861f1 [file] [log] [blame]
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +00001#!/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
17if [ ! -d libcore ]; then
18 echo "Script needs to be run at the root of the android tree"
19 exit 1
20fi
21
Colin Crosse0ef0a82017-07-27 21:29:18 +000022source build/envsetup.sh >&/dev/null # for get_build_var, setpaths
23setpaths # include platform prebuilt java, javac, etc in $PATH.
Shubham Ajmerac33c0872017-07-20 18:41:52 -070024
Andreas Gampeebd089d2016-07-18 14:56:56 -070025if [ -z "$ANDROID_HOST_OUT" ] ; then
26 ANDROID_HOST_OUT=${OUT_DIR-$ANDROID_BUILD_TOP/out}/host/linux-x86
27fi
28
Roland Levillain08f7c1d2018-05-25 15:34:41 +010029# "Root" (actually "system") directory on device (in the case of
30# target testing).
31android_root=${ART_TEST_ANDROID_ROOT:-/system}
Roland Levillain1c361882018-03-02 14:23:51 +000032
Alex Light617c9c52017-08-18 11:52:25 -070033java_lib_location="${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES"
34make_target_name="apache-harmony-jdwp-tests-hostdex"
Igor Murashkin84f26322017-06-06 11:36:33 -070035
Vladimir Marko91f10322018-12-07 18:04:10 +000036function boot_classpath_arg {
37 local dir="$1"
38 local suffix="$2"
39 shift 2
40 local separator=""
41 for var
42 do
43 printf -- "${separator}${dir}/${var}${suffix}.jar";
44 separator=":"
45 done
46}
47
Vladimir Marko0ace5632018-12-14 11:11:47 +000048# Note: This must start with the CORE_IMG_JARS in Android.common_path.mk
Vladimir Marko91f10322018-12-07 18:04:10 +000049# because that's what we use for compiling the core.art image.
Vladimir Marko0ace5632018-12-14 11:11:47 +000050# It may contain additional modules from TEST_CORE_JARS.
Neil Fullerb4a70ce2018-11-09 15:49:05 +000051BOOT_CLASSPATH_JARS="core-oj core-libart okhttp bouncycastle apache-xml conscrypt"
Vladimir Marko91f10322018-12-07 18:04:10 +000052
Alex Light617c9c52017-08-18 11:52:25 -070053vm_args=""
Roland Levillain1c361882018-03-02 14:23:51 +000054art="$android_root/bin/art"
55art_debugee="sh $android_root/bin/art"
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000056args=$@
Roland Levillain08f7c1d2018-05-25 15:34:41 +010057chroot_option=
Nicolas Geoffrayd553b432015-07-13 14:35:17 +010058debuggee_args="-Xcompiler-option --debuggable"
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000059device_dir="--device-dir=/data/local/tmp"
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +010060# We use the art script on target to ensure the runner and the debuggee share the same
61# image.
62vm_command="--vm-command=$art"
Nicolas Geoffraya2c18612015-03-30 23:01:28 +010063image_compiler_option=""
Alex Light617c9c52017-08-18 11:52:25 -070064plugin=""
Nicolas Geoffray9648a632015-06-15 14:35:01 +010065debug="no"
Alex Light84b92e02017-09-29 13:46:14 -070066explicit_debug="no"
Sebastien Hertza646aaf2015-09-10 12:03:51 +020067verbose="no"
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +000068image="-Ximage:/data/art-test/core.art"
Vladimir Marko91f10322018-12-07 18:04:10 +000069boot_classpath="$(boot_classpath_arg /system/framework -testdex $BOOT_CLASSPATH_JARS)"
70boot_classpath_locations=""
Alex Light0ac2e5c2017-09-19 15:35:20 -070071with_jdwp_path=""
72agent_wrapper=""
Nicolas Geoffray95186552015-10-28 13:06:21 +000073vm_args=""
Sebastien Hertza646aaf2015-09-10 12:03:51 +020074# By default, we run the whole JDWP test suite.
Alex Light84b92e02017-09-29 13:46:14 -070075has_specific_test="no"
Sebastien Hertza646aaf2015-09-10 12:03:51 +020076test="org.apache.harmony.jpda.tests.share.AllTests"
Alex Light617c9c52017-08-18 11:52:25 -070077mode="target"
Roland Levillain5db109b2016-05-19 12:24:17 +010078# Use JIT compiling by default.
79use_jit=true
Alex Lightd0d25fe2018-07-20 15:46:49 -070080instant_jit=false
Andreas Gampe85b286b2015-12-30 19:37:48 -080081variant_cmdline_parameter="--variant=X32"
Alex Light878f33f2018-02-08 11:16:39 -080082dump_command="/bin/true"
Sebastien Hertzc3b208c2017-03-27 11:35:54 +020083# Timeout of JDWP test in ms.
84#
85# Note: some tests expect a timeout to check that *no* reply/event is received for a specific case.
86# A lower timeout can save up several minutes when running the whole test suite, especially for
87# continuous testing. This value can be adjusted to fit the configuration of the host machine(s).
88jdwp_test_timeout=10000
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000089
Alex Light84b92e02017-09-29 13:46:14 -070090gdb_target=
91has_gdb="no"
92
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000093while true; do
94 if [[ "$1" == "--mode=host" ]]; then
Alex Light617c9c52017-08-18 11:52:25 -070095 mode="host"
Nicolas Geoffray59786902015-03-30 16:34:16 +010096 # Specify bash explicitly since the art script cannot, since it has to run on the device
97 # with mksh.
Alex Lightb15fea22015-09-17 16:59:09 -070098 art="bash ${OUT_DIR-out}/host/linux-x86/bin/art"
99 art_debugee="bash ${OUT_DIR-out}/host/linux-x86/bin/art"
Andreas Gampe8994a042015-12-30 19:03:17 +0000100 # We force generation of a new image to avoid build-time and run-time classpath differences.
101 image="-Ximage:/system/non/existent/vogar.art"
Vladimir Marko91f10322018-12-07 18:04:10 +0000102 # Pass the host boot classpath.
103 if [ "${ANDROID_HOST_OUT:0:${#ANDROID_BUILD_TOP}+1}" = "${ANDROID_BUILD_TOP}/" ]; then
104 framework_location="${ANDROID_HOST_OUT:${#ANDROID_BUILD_TOP}+1}/framework"
105 else
106 echo "error: ANDROID_BUILD_TOP/ is not a prefix of ANDROID_HOST_OUT"
107 echo "ANDROID_BUILD_TOP=${ANDROID_BUILD_TOP}"
108 echo "ANDROID_HOST_OUT=${ANDROID_HOST_OUT}"
109 exit
110 fi
111 boot_classpath="$(boot_classpath_arg ${ANDROID_HOST_OUT}/framework -hostdex $BOOT_CLASSPATH_JARS)"
112 boot_classpath_locations="$(boot_classpath_arg ${framework_location} -hostdex $BOOT_CLASSPATH_JARS)"
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +0100113 # We do not need a device directory on host.
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000114 device_dir=""
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +0100115 # Vogar knows which VM to use on host.
116 vm_command=""
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000117 shift
Nicolas Geoffray191cae32019-01-09 09:36:03 +0000118 elif [[ "$1" == "--mode=device" ]]; then
119 # Remove the --mode=device from the arguments and replace it with --mode=device_testdex
120 args=${args/$1}
121 args="$args --mode=device_testdex"
122 shift
Alex Light617c9c52017-08-18 11:52:25 -0700123 elif [[ "$1" == "--mode=jvm" ]]; then
124 mode="ri"
Paul Duffin50715312019-07-11 15:44:25 +0100125 make_target_name="apache-harmony-jdwp-tests"
Alex Light617c9c52017-08-18 11:52:25 -0700126 art="$(which java)"
127 art_debugee="$(which java)"
128 # No need for extra args.
129 debuggee_args=""
130 # No image. On the RI.
131 image=""
Vladimir Marko91f10322018-12-07 18:04:10 +0000132 boot_classpath=""
133 boot_classpath_locations=""
Alex Light617c9c52017-08-18 11:52:25 -0700134 # We do not need a device directory on RI.
135 device_dir=""
136 # Vogar knows which VM to use on RI.
137 vm_command=""
138 # We don't care about jit with the RI
139 use_jit=false
140 shift
Alex Lightec4a10c2017-11-17 09:06:26 -0800141 elif [[ $1 == --test-timeout-ms ]]; then
142 # Remove the --test-timeout-ms from the arguments.
143 args=${args/$1}
144 shift
145 jdwp_test_timeout=$1
146 # Remove the argument
147 args=${args/$1}
148 shift
Alex Light0ac2e5c2017-09-19 15:35:20 -0700149 elif [[ $1 == --agent-wrapper ]]; then
150 # Remove the --agent-wrapper from the arguments.
151 args=${args/$1}
152 shift
153 agent_wrapper=${agent_wrapper}${1},
154 # Remove the argument
155 args=${args/$1}
156 shift
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000157 elif [[ $1 == -Ximage:* ]]; then
158 image="$1"
159 shift
Alex Lightd0d25fe2018-07-20 15:46:49 -0700160 elif [[ "$1" == "--instant-jit" ]]; then
161 instant_jit=true
162 # Remove the --instant-jit from the arguments.
163 args=${args/$1}
164 shift
Roland Levillain5db109b2016-05-19 12:24:17 +0100165 elif [[ "$1" == "--no-jit" ]]; then
166 use_jit=false
167 # Remove the --no-jit from the arguments.
168 args=${args/$1}
169 shift
Alex Light84b92e02017-09-29 13:46:14 -0700170 elif [[ $1 == "--no-debug" ]]; then
171 explicit_debug="yes"
172 debug="no"
173 # Remove the --no-debug from the arguments.
174 args=${args/$1}
175 shift
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100176 elif [[ $1 == "--debug" ]]; then
Alex Light84b92e02017-09-29 13:46:14 -0700177 explicit_debug="yes"
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100178 debug="yes"
179 # Remove the --debug from the arguments.
180 args=${args/$1}
181 shift
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200182 elif [[ $1 == "--verbose" ]]; then
183 verbose="yes"
184 # Remove the --verbose from the arguments.
185 args=${args/$1}
186 shift
Alex Light84b92e02017-09-29 13:46:14 -0700187 elif [[ $1 == "--gdbserver" ]]; then
188 # Remove the --gdbserver from the arguments.
189 args=${args/$1}
190 has_gdb="yes"
191 shift
192 gdb_target=$1
193 # Remove the target from the arguments.
194 args=${args/$1}
195 shift
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200196 elif [[ $1 == "--test" ]]; then
197 # Remove the --test from the arguments.
198 args=${args/$1}
199 shift
Alex Light84b92e02017-09-29 13:46:14 -0700200 has_specific_test="yes"
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200201 test=$1
202 # Remove the test from the arguments.
203 args=${args/$1}
204 shift
Alex Light617c9c52017-08-18 11:52:25 -0700205 elif [[ "$1" == "--jdwp-path" ]]; then
206 # Remove the --jdwp-path from the arguments.
207 args=${args/$1}
208 shift
Alex Light0ac2e5c2017-09-19 15:35:20 -0700209 with_jdwp_path=$1
Alex Light617c9c52017-08-18 11:52:25 -0700210 # Remove the path from the arguments.
211 args=${args/$1}
212 shift
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000213 elif [[ "$1" == "" ]]; then
214 break
Andreas Gampe85b286b2015-12-30 19:37:48 -0800215 elif [[ $1 == --variant=* ]]; then
216 variant_cmdline_parameter=$1
217 shift
Alex Light617c9c52017-08-18 11:52:25 -0700218 elif [[ $1 == -Xplugin:* ]]; then
219 plugin="$1"
220 args=${args/$1}
221 shift
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000222 else
223 shift
224 fi
225done
226
Roland Levillain08f7c1d2018-05-25 15:34:41 +0100227if [[ $mode == "target" ]]; then
228 # Honor environment variable ART_TEST_CHROOT.
229 if [[ -n "$ART_TEST_CHROOT" ]]; then
230 # Set Vogar's `--chroot` option.
231 chroot_option="--chroot $ART_TEST_CHROOT"
232 # Adjust settings for chroot environment.
233 art="/system/bin/art"
234 art_debugee="sh /system/bin/art"
235 vm_command="--vm-command=$art"
236 device_dir="--device-dir=/tmp"
237 fi
Roland Levillaine4f1c512017-10-30 13:28:28 +0000238fi
239
Alex Light84b92e02017-09-29 13:46:14 -0700240if [[ $has_gdb = "yes" ]]; then
241 if [[ $explicit_debug = "no" ]]; then
242 debug="yes"
243 fi
244fi
245
Alex Light617c9c52017-08-18 11:52:25 -0700246if [[ $mode == "ri" ]]; then
Alex Light0ac2e5c2017-09-19 15:35:20 -0700247 if [[ "x$with_jdwp_path" != "x" ]]; then
248 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentArgument=-agentpath:${agent_wrapper}"
249 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentName=$with_jdwp_path"
250 fi
Alex Light617c9c52017-08-18 11:52:25 -0700251 if [[ "x$image" != "x" ]]; then
252 echo "Cannot use -Ximage: with --mode=jvm"
253 exit 1
Alex Light84b92e02017-09-29 13:46:14 -0700254 elif [[ $has_gdb = "yes" ]]; then
255 echo "Cannot use --gdbserver with --mode=jvm"
256 exit 1
Alex Light617c9c52017-08-18 11:52:25 -0700257 elif [[ $debug == "yes" ]]; then
258 echo "Cannot use --debug with --mode=jvm"
259 exit 1
260 fi
261else
Alex Light878f33f2018-02-08 11:16:39 -0800262 if [[ "$mode" == "host" ]]; then
263 dump_command="/bin/kill -3"
264 else
Roland Levillainb52dbb72018-05-01 14:03:45 +0100265 # Note that this dumping command won't work when `$android_root`
266 # is different from `/system` (e.g. on ART Buildbot devices) when
267 # the device is running Android N, as the debuggerd protocol
268 # changed in an incompatible way in Android O (see b/32466479).
269 dump_command="$android_root/xbin/su root $android_root/bin/debuggerd"
Alex Light878f33f2018-02-08 11:16:39 -0800270 fi
Alex Light84b92e02017-09-29 13:46:14 -0700271 if [[ $has_gdb = "yes" ]]; then
272 if [[ $mode == "target" ]]; then
273 echo "Cannot use --gdbserver with --mode=target"
274 exit 1
275 else
276 art_debugee="$art_debugee --gdbserver $gdb_target"
277 # The tests absolutely require some timeout. We set a ~2 week timeout since we can kill the
278 # test with gdb if it goes on too long.
279 jdwp_test_timeout="1000000000"
280 fi
281 fi
Alex Light0ac2e5c2017-09-19 15:35:20 -0700282 if [[ "x$with_jdwp_path" != "x" ]]; then
283 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentArgument=-agentpath:${agent_wrapper}"
284 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentName=${with_jdwp_path}"
285 fi
Alex Light617c9c52017-08-18 11:52:25 -0700286 vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --debuggable"
Alex Lightbaac7e42018-06-08 15:30:11 +0000287 # we don't want to be trying to connect to adbconnection which might not have
288 # been built.
289 vm_args="${vm_args} --vm-arg -XjdwpProvider:none"
Nicolas Geoffrayf983c732018-09-12 09:27:29 +0100290 # Make sure the debuggee doesn't re-generate, nor clean up what the debugger has generated.
291 art_debugee="$art_debugee --no-compile --no-clean"
Alex Light617c9c52017-08-18 11:52:25 -0700292fi
293
294function jlib_name {
295 local path=$1
296 local str="classes"
297 local suffix="jar"
298 if [[ $mode == "ri" ]]; then
Alex Light617c9c52017-08-18 11:52:25 -0700299 str="javalib"
Alex Light617c9c52017-08-18 11:52:25 -0700300 fi
301 echo "$path/$str.$suffix"
302}
303
304# Jar containing all the tests.
305test_jar=$(jlib_name "${java_lib_location}/${make_target_name}_intermediates")
306
307if [[ ! -f $test_jar ]]; then
308 echo "Before running, you must build jdwp tests and vogar:" \
Roland Levillaine47933a2019-08-09 14:06:02 +0100309 "m ${make_target_name} vogar"
Alex Light617c9c52017-08-18 11:52:25 -0700310 exit 1
311fi
Nicolas Geoffrayc0c07852017-08-08 09:44:15 +0100312
Andreas Gampe85b286b2015-12-30 19:37:48 -0800313# For the host:
314#
315# If, on the other hand, there is a variant set, use it to modify the art_debugee parameter to
316# force the fork to have the same bitness as the controller. This should be fine and not impact
317# testing (cross-bitness), as the protocol is always 64-bit anyways (our implementation).
318#
319# Note: this isn't necessary for the device as the BOOTCLASSPATH environment variable is set there
320# and used as a fallback.
Alex Light617c9c52017-08-18 11:52:25 -0700321if [[ $mode == "host" ]]; then
Andreas Gampe85b286b2015-12-30 19:37:48 -0800322 variant=${variant_cmdline_parameter:10}
323 if [[ $variant == "x32" || $variant == "X32" ]]; then
324 art_debugee="$art_debugee --32"
325 elif [[ $variant == "x64" || $variant == "X64" ]]; then
326 art_debugee="$art_debugee --64"
327 else
328 echo "Error, do not understand variant $variant_cmdline_parameter."
329 exit 1
330 fi
331fi
332
Nicolas Geoffray95186552015-10-28 13:06:21 +0000333if [[ "$image" != "" ]]; then
Alex Light617c9c52017-08-18 11:52:25 -0700334 vm_args="$vm_args --vm-arg $image"
Vladimir Marko91f10322018-12-07 18:04:10 +0000335 debuggee_args="$debuggee_args $image"
336fi
337if [[ "$boot_classpath" != "" ]]; then
338 vm_args="$vm_args --vm-arg -Xbootclasspath:${boot_classpath}"
339 debuggee_args="$debuggee_args -Xbootclasspath:${boot_classpath}"
340fi
341if [[ "$boot_classpath_locations" != "" ]]; then
342 vm_args="$vm_args --vm-arg -Xbootclasspath-locations:${boot_classpath_locations}"
343 debuggee_args="$debuggee_args -Xbootclasspath-locations:${boot_classpath_locations}"
Nicolas Geoffray95186552015-10-28 13:06:21 +0000344fi
Alex Light617c9c52017-08-18 11:52:25 -0700345
346if [[ "$plugin" != "" ]]; then
347 vm_args="$vm_args --vm-arg $plugin"
348fi
349
Alex Light617c9c52017-08-18 11:52:25 -0700350if [[ $mode != "ri" ]]; then
Andreas Gampe817dc662018-09-25 18:08:52 -0700351 # Because we're running debuggable, we discard any AOT code.
352 # Therefore we run de2oat with 'quicken' to avoid spending time compiling.
353 vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken"
354 debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken"
355
356 if $instant_jit; then
357 debuggee_args="$debuggee_args -Xjitthreshold:0"
358 fi
359
Alex Light617c9c52017-08-18 11:52:25 -0700360 vm_args="$vm_args --vm-arg -Xusejit:$use_jit"
361 debuggee_args="$debuggee_args -Xusejit:$use_jit"
362fi
363
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100364if [[ $debug == "yes" ]]; then
365 art="$art -d"
366 art_debugee="$art_debugee -d"
Andreas Gampe1c5b42f2017-06-15 18:20:45 -0700367 vm_args="$vm_args --vm-arg -XXlib:libartd.so --vm-arg -XX:SlowDebug=true"
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100368fi
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200369if [[ $verbose == "yes" ]]; then
370 # Enable JDWP logs in the debuggee.
371 art_debugee="$art_debugee -verbose:jdwp"
372fi
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100373
Neil Fuller239bdf62018-01-08 18:55:36 +0000374if [[ $mode != "ri" ]]; then
Neil Fullerc546ec92018-01-05 15:00:35 +0000375 toolchain_args="--toolchain d8 --language CUR"
Alex Light264a4862018-01-31 16:47:58 +0000376 if [[ "x$with_jdwp_path" == "x" ]]; then
377 # Need to enable the internal jdwp implementation.
378 art_debugee="${art_debugee} -XjdwpProvider:internal"
Alex Lightbaac7e42018-06-08 15:30:11 +0000379 else
380 # need to disable the jdwpProvider since we give the agent explicitly on the
381 # cmdline.
382 art_debugee="${art_debugee} -XjdwpProvider:none"
Alex Light264a4862018-01-31 16:47:58 +0000383 fi
Alex Light8d8299d2017-11-10 08:41:04 -0800384else
385 toolchain_args="--toolchain javac --language CUR"
Igor Murashkin84f26322017-06-06 11:36:33 -0700386fi
387
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000388# Run the tests using vogar.
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +0100389vogar $vm_command \
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100390 $vm_args \
Nicolas Geoffray9620b9d2015-03-30 12:28:26 +0100391 --verbose \
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000392 $args \
Roland Levillain08f7c1d2018-05-25 15:34:41 +0100393 $chroot_option \
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000394 $device_dir \
Nicolas Geoffraya2c18612015-03-30 23:01:28 +0100395 $image_compiler_option \
Nicolas Geoffray472b00c2015-05-06 14:57:09 +0100396 --timeout 800 \
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000397 --vm-arg -Djpda.settings.verbose=true \
Sebastien Hertzc3b208c2017-03-27 11:35:54 +0200398 --vm-arg -Djpda.settings.timeout=$jdwp_test_timeout \
399 --vm-arg -Djpda.settings.waitingTime=$jdwp_test_timeout \
Nicolas Geoffraya2c18612015-03-30 23:01:28 +0100400 --vm-arg -Djpda.settings.transportAddress=127.0.0.1:55107 \
Alex Light878f33f2018-02-08 11:16:39 -0800401 --vm-arg -Djpda.settings.dumpProcess="$dump_command" \
Vladimir Marko91f10322018-12-07 18:04:10 +0000402 --vm-arg -Djpda.settings.debuggeeJavaPath="$art_debugee $plugin $debuggee_args" \
Igor Murashkin84f26322017-06-06 11:36:33 -0700403 --classpath "$test_jar" \
404 $toolchain_args \
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200405 $test
Hiroshi Yamauchia166bbb2015-11-19 16:24:31 -0800406
407vogar_exit_status=$?
408
409echo "Killing stalled dalvikvm processes..."
Alex Lightc611ffa2017-10-18 08:59:16 -0700410if [[ $mode == "host" ]]; then
Hiroshi Yamauchia166bbb2015-11-19 16:24:31 -0800411 pkill -9 -f /bin/dalvikvm
412else
Orion Hodsoncfb4ed52018-05-22 10:48:52 +0100413 # Tests may run on older Android versions where pkill requires "-l SIGNAL"
414 # rather than "-SIGNAL".
415 adb shell pkill -l 9 -f /bin/dalvikvm
Hiroshi Yamauchia166bbb2015-11-19 16:24:31 -0800416fi
417echo "Done."
418
419exit $vogar_exit_status