blob: fbd80777e56f5c59984ed48ceb9782d119132cda [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
Roland Levillain3dfaab02018-04-03 15:34:40 +010022# 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)
28case "$ANDROID_SERIAL" in
29 (FA7BN1A04406|FA7BN1A04412|FA7BN1A04433) exit 0;;
30esac
31
Colin Crosse0ef0a82017-07-27 21:29:18 +000032source build/envsetup.sh >&/dev/null # for get_build_var, setpaths
33setpaths # include platform prebuilt java, javac, etc in $PATH.
Shubham Ajmerac33c0872017-07-20 18:41:52 -070034
Andreas Gampeebd089d2016-07-18 14:56:56 -070035if [ -z "$ANDROID_HOST_OUT" ] ; then
36 ANDROID_HOST_OUT=${OUT_DIR-$ANDROID_BUILD_TOP/out}/host/linux-x86
37fi
38
Roland Levillain08f7c1d2018-05-25 15:34:41 +010039# "Root" (actually "system") directory on device (in the case of
40# target testing).
41android_root=${ART_TEST_ANDROID_ROOT:-/system}
Roland Levillain1c361882018-03-02 14:23:51 +000042
Alex Light617c9c52017-08-18 11:52:25 -070043java_lib_location="${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES"
44make_target_name="apache-harmony-jdwp-tests-hostdex"
Igor Murashkin84f26322017-06-06 11:36:33 -070045
Vladimir Marko91f10322018-12-07 18:04:10 +000046function boot_classpath_arg {
47 local dir="$1"
48 local suffix="$2"
49 shift 2
50 local separator=""
51 for var
52 do
53 printf -- "${separator}${dir}/${var}${suffix}.jar";
54 separator=":"
55 done
56}
57
Vladimir Marko0ace5632018-12-14 11:11:47 +000058# Note: This must start with the CORE_IMG_JARS in Android.common_path.mk
Vladimir Marko91f10322018-12-07 18:04:10 +000059# because that's what we use for compiling the core.art image.
Vladimir Marko0ace5632018-12-14 11:11:47 +000060# It may contain additional modules from TEST_CORE_JARS.
Neil Fullerb4a70ce2018-11-09 15:49:05 +000061BOOT_CLASSPATH_JARS="core-oj core-libart okhttp bouncycastle apache-xml conscrypt"
Vladimir Marko91f10322018-12-07 18:04:10 +000062
Alex Light617c9c52017-08-18 11:52:25 -070063vm_args=""
Roland Levillain1c361882018-03-02 14:23:51 +000064art="$android_root/bin/art"
65art_debugee="sh $android_root/bin/art"
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000066args=$@
Roland Levillain08f7c1d2018-05-25 15:34:41 +010067chroot_option=
Nicolas Geoffrayd553b432015-07-13 14:35:17 +010068debuggee_args="-Xcompiler-option --debuggable"
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000069device_dir="--device-dir=/data/local/tmp"
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +010070# We use the art script on target to ensure the runner and the debuggee share the same
71# image.
72vm_command="--vm-command=$art"
Nicolas Geoffraya2c18612015-03-30 23:01:28 +010073image_compiler_option=""
Alex Light617c9c52017-08-18 11:52:25 -070074plugin=""
Nicolas Geoffray9648a632015-06-15 14:35:01 +010075debug="no"
Alex Light84b92e02017-09-29 13:46:14 -070076explicit_debug="no"
Sebastien Hertza646aaf2015-09-10 12:03:51 +020077verbose="no"
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +000078image="-Ximage:/data/art-test/core.art"
Vladimir Marko91f10322018-12-07 18:04:10 +000079boot_classpath="$(boot_classpath_arg /system/framework -testdex $BOOT_CLASSPATH_JARS)"
80boot_classpath_locations=""
Alex Light0ac2e5c2017-09-19 15:35:20 -070081with_jdwp_path=""
82agent_wrapper=""
Nicolas Geoffray95186552015-10-28 13:06:21 +000083vm_args=""
Sebastien Hertza646aaf2015-09-10 12:03:51 +020084# By default, we run the whole JDWP test suite.
Alex Light84b92e02017-09-29 13:46:14 -070085has_specific_test="no"
Sebastien Hertza646aaf2015-09-10 12:03:51 +020086test="org.apache.harmony.jpda.tests.share.AllTests"
Alex Light617c9c52017-08-18 11:52:25 -070087mode="target"
Roland Levillain5db109b2016-05-19 12:24:17 +010088# Use JIT compiling by default.
89use_jit=true
Alex Lightd0d25fe2018-07-20 15:46:49 -070090instant_jit=false
Andreas Gampe85b286b2015-12-30 19:37:48 -080091variant_cmdline_parameter="--variant=X32"
Alex Light878f33f2018-02-08 11:16:39 -080092dump_command="/bin/true"
Sebastien Hertzc3b208c2017-03-27 11:35:54 +020093# Timeout of JDWP test in ms.
94#
95# Note: some tests expect a timeout to check that *no* reply/event is received for a specific case.
96# A lower timeout can save up several minutes when running the whole test suite, especially for
97# continuous testing. This value can be adjusted to fit the configuration of the host machine(s).
98jdwp_test_timeout=10000
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +000099
Alex Light84b92e02017-09-29 13:46:14 -0700100gdb_target=
101has_gdb="no"
102
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000103while true; do
104 if [[ "$1" == "--mode=host" ]]; then
Alex Light617c9c52017-08-18 11:52:25 -0700105 mode="host"
Nicolas Geoffray59786902015-03-30 16:34:16 +0100106 # Specify bash explicitly since the art script cannot, since it has to run on the device
107 # with mksh.
Alex Lightb15fea22015-09-17 16:59:09 -0700108 art="bash ${OUT_DIR-out}/host/linux-x86/bin/art"
109 art_debugee="bash ${OUT_DIR-out}/host/linux-x86/bin/art"
Andreas Gampe8994a042015-12-30 19:03:17 +0000110 # We force generation of a new image to avoid build-time and run-time classpath differences.
111 image="-Ximage:/system/non/existent/vogar.art"
Vladimir Marko91f10322018-12-07 18:04:10 +0000112 # Pass the host boot classpath.
113 if [ "${ANDROID_HOST_OUT:0:${#ANDROID_BUILD_TOP}+1}" = "${ANDROID_BUILD_TOP}/" ]; then
114 framework_location="${ANDROID_HOST_OUT:${#ANDROID_BUILD_TOP}+1}/framework"
115 else
116 echo "error: ANDROID_BUILD_TOP/ is not a prefix of ANDROID_HOST_OUT"
117 echo "ANDROID_BUILD_TOP=${ANDROID_BUILD_TOP}"
118 echo "ANDROID_HOST_OUT=${ANDROID_HOST_OUT}"
119 exit
120 fi
121 boot_classpath="$(boot_classpath_arg ${ANDROID_HOST_OUT}/framework -hostdex $BOOT_CLASSPATH_JARS)"
122 boot_classpath_locations="$(boot_classpath_arg ${framework_location} -hostdex $BOOT_CLASSPATH_JARS)"
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +0100123 # We do not need a device directory on host.
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000124 device_dir=""
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +0100125 # Vogar knows which VM to use on host.
126 vm_command=""
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000127 shift
Nicolas Geoffray191cae32019-01-09 09:36:03 +0000128 elif [[ "$1" == "--mode=device" ]]; then
129 # Remove the --mode=device from the arguments and replace it with --mode=device_testdex
130 args=${args/$1}
131 args="$args --mode=device_testdex"
132 shift
Alex Light617c9c52017-08-18 11:52:25 -0700133 elif [[ "$1" == "--mode=jvm" ]]; then
134 mode="ri"
135 make_target_name="apache-harmony-jdwp-tests-host"
136 art="$(which java)"
137 art_debugee="$(which java)"
138 # No need for extra args.
139 debuggee_args=""
140 # No image. On the RI.
141 image=""
Vladimir Marko91f10322018-12-07 18:04:10 +0000142 boot_classpath=""
143 boot_classpath_locations=""
Alex Light617c9c52017-08-18 11:52:25 -0700144 # We do not need a device directory on RI.
145 device_dir=""
146 # Vogar knows which VM to use on RI.
147 vm_command=""
148 # We don't care about jit with the RI
149 use_jit=false
150 shift
Alex Lightec4a10c2017-11-17 09:06:26 -0800151 elif [[ $1 == --test-timeout-ms ]]; then
152 # Remove the --test-timeout-ms from the arguments.
153 args=${args/$1}
154 shift
155 jdwp_test_timeout=$1
156 # Remove the argument
157 args=${args/$1}
158 shift
Alex Light0ac2e5c2017-09-19 15:35:20 -0700159 elif [[ $1 == --agent-wrapper ]]; then
160 # Remove the --agent-wrapper from the arguments.
161 args=${args/$1}
162 shift
163 agent_wrapper=${agent_wrapper}${1},
164 # Remove the argument
165 args=${args/$1}
166 shift
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000167 elif [[ $1 == -Ximage:* ]]; then
168 image="$1"
169 shift
Alex Lightd0d25fe2018-07-20 15:46:49 -0700170 elif [[ "$1" == "--instant-jit" ]]; then
171 instant_jit=true
172 # Remove the --instant-jit from the arguments.
173 args=${args/$1}
174 shift
Roland Levillain5db109b2016-05-19 12:24:17 +0100175 elif [[ "$1" == "--no-jit" ]]; then
176 use_jit=false
177 # Remove the --no-jit from the arguments.
178 args=${args/$1}
179 shift
Alex Light84b92e02017-09-29 13:46:14 -0700180 elif [[ $1 == "--no-debug" ]]; then
181 explicit_debug="yes"
182 debug="no"
183 # Remove the --no-debug from the arguments.
184 args=${args/$1}
185 shift
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100186 elif [[ $1 == "--debug" ]]; then
Alex Light84b92e02017-09-29 13:46:14 -0700187 explicit_debug="yes"
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100188 debug="yes"
189 # Remove the --debug from the arguments.
190 args=${args/$1}
191 shift
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200192 elif [[ $1 == "--verbose" ]]; then
193 verbose="yes"
194 # Remove the --verbose from the arguments.
195 args=${args/$1}
196 shift
Alex Light84b92e02017-09-29 13:46:14 -0700197 elif [[ $1 == "--gdbserver" ]]; then
198 # Remove the --gdbserver from the arguments.
199 args=${args/$1}
200 has_gdb="yes"
201 shift
202 gdb_target=$1
203 # Remove the target from the arguments.
204 args=${args/$1}
205 shift
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200206 elif [[ $1 == "--test" ]]; then
207 # Remove the --test from the arguments.
208 args=${args/$1}
209 shift
Alex Light84b92e02017-09-29 13:46:14 -0700210 has_specific_test="yes"
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200211 test=$1
212 # Remove the test from the arguments.
213 args=${args/$1}
214 shift
Alex Light617c9c52017-08-18 11:52:25 -0700215 elif [[ "$1" == "--jdwp-path" ]]; then
216 # Remove the --jdwp-path from the arguments.
217 args=${args/$1}
218 shift
Alex Light0ac2e5c2017-09-19 15:35:20 -0700219 with_jdwp_path=$1
Alex Light617c9c52017-08-18 11:52:25 -0700220 # Remove the path from the arguments.
221 args=${args/$1}
222 shift
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000223 elif [[ "$1" == "" ]]; then
224 break
Andreas Gampe85b286b2015-12-30 19:37:48 -0800225 elif [[ $1 == --variant=* ]]; then
226 variant_cmdline_parameter=$1
227 shift
Alex Light617c9c52017-08-18 11:52:25 -0700228 elif [[ $1 == -Xplugin:* ]]; then
229 plugin="$1"
230 args=${args/$1}
231 shift
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000232 else
233 shift
234 fi
235done
236
Roland Levillain08f7c1d2018-05-25 15:34:41 +0100237if [[ $mode == "target" ]]; then
238 # Honor environment variable ART_TEST_CHROOT.
239 if [[ -n "$ART_TEST_CHROOT" ]]; then
240 # Set Vogar's `--chroot` option.
241 chroot_option="--chroot $ART_TEST_CHROOT"
242 # Adjust settings for chroot environment.
243 art="/system/bin/art"
244 art_debugee="sh /system/bin/art"
245 vm_command="--vm-command=$art"
246 device_dir="--device-dir=/tmp"
247 fi
Roland Levillaine4f1c512017-10-30 13:28:28 +0000248fi
249
Alex Light84b92e02017-09-29 13:46:14 -0700250if [[ $has_gdb = "yes" ]]; then
251 if [[ $explicit_debug = "no" ]]; then
252 debug="yes"
253 fi
254fi
255
Alex Light617c9c52017-08-18 11:52:25 -0700256if [[ $mode == "ri" ]]; then
Alex Light0ac2e5c2017-09-19 15:35:20 -0700257 if [[ "x$with_jdwp_path" != "x" ]]; then
258 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentArgument=-agentpath:${agent_wrapper}"
259 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentName=$with_jdwp_path"
260 fi
Alex Light617c9c52017-08-18 11:52:25 -0700261 if [[ "x$image" != "x" ]]; then
262 echo "Cannot use -Ximage: with --mode=jvm"
263 exit 1
Alex Light84b92e02017-09-29 13:46:14 -0700264 elif [[ $has_gdb = "yes" ]]; then
265 echo "Cannot use --gdbserver with --mode=jvm"
266 exit 1
Alex Light617c9c52017-08-18 11:52:25 -0700267 elif [[ $debug == "yes" ]]; then
268 echo "Cannot use --debug with --mode=jvm"
269 exit 1
270 fi
271else
Alex Light878f33f2018-02-08 11:16:39 -0800272 if [[ "$mode" == "host" ]]; then
273 dump_command="/bin/kill -3"
274 else
Roland Levillainb52dbb72018-05-01 14:03:45 +0100275 # Note that this dumping command won't work when `$android_root`
276 # is different from `/system` (e.g. on ART Buildbot devices) when
277 # the device is running Android N, as the debuggerd protocol
278 # changed in an incompatible way in Android O (see b/32466479).
279 dump_command="$android_root/xbin/su root $android_root/bin/debuggerd"
Alex Light878f33f2018-02-08 11:16:39 -0800280 fi
Alex Light84b92e02017-09-29 13:46:14 -0700281 if [[ $has_gdb = "yes" ]]; then
282 if [[ $mode == "target" ]]; then
283 echo "Cannot use --gdbserver with --mode=target"
284 exit 1
285 else
286 art_debugee="$art_debugee --gdbserver $gdb_target"
287 # The tests absolutely require some timeout. We set a ~2 week timeout since we can kill the
288 # test with gdb if it goes on too long.
289 jdwp_test_timeout="1000000000"
290 fi
291 fi
Alex Light0ac2e5c2017-09-19 15:35:20 -0700292 if [[ "x$with_jdwp_path" != "x" ]]; then
293 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentArgument=-agentpath:${agent_wrapper}"
294 vm_args="${vm_args} --vm-arg -Djpda.settings.debuggeeAgentName=${with_jdwp_path}"
295 fi
Alex Light617c9c52017-08-18 11:52:25 -0700296 vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --debuggable"
Alex Lightbaac7e42018-06-08 15:30:11 +0000297 # we don't want to be trying to connect to adbconnection which might not have
298 # been built.
299 vm_args="${vm_args} --vm-arg -XjdwpProvider:none"
Nicolas Geoffrayf983c732018-09-12 09:27:29 +0100300 # Make sure the debuggee doesn't re-generate, nor clean up what the debugger has generated.
301 art_debugee="$art_debugee --no-compile --no-clean"
Alex Light617c9c52017-08-18 11:52:25 -0700302fi
303
304function jlib_name {
305 local path=$1
306 local str="classes"
307 local suffix="jar"
308 if [[ $mode == "ri" ]]; then
Alex Light617c9c52017-08-18 11:52:25 -0700309 str="javalib"
Alex Light617c9c52017-08-18 11:52:25 -0700310 fi
311 echo "$path/$str.$suffix"
312}
313
314# Jar containing all the tests.
315test_jar=$(jlib_name "${java_lib_location}/${make_target_name}_intermediates")
316
317if [[ ! -f $test_jar ]]; then
318 echo "Before running, you must build jdwp tests and vogar:" \
319 "make ${make_target_name} vogar"
320 exit 1
321fi
Nicolas Geoffrayc0c07852017-08-08 09:44:15 +0100322
Andreas Gampe85b286b2015-12-30 19:37:48 -0800323# For the host:
324#
325# If, on the other hand, there is a variant set, use it to modify the art_debugee parameter to
326# force the fork to have the same bitness as the controller. This should be fine and not impact
327# testing (cross-bitness), as the protocol is always 64-bit anyways (our implementation).
328#
329# Note: this isn't necessary for the device as the BOOTCLASSPATH environment variable is set there
330# and used as a fallback.
Alex Light617c9c52017-08-18 11:52:25 -0700331if [[ $mode == "host" ]]; then
Andreas Gampe85b286b2015-12-30 19:37:48 -0800332 variant=${variant_cmdline_parameter:10}
333 if [[ $variant == "x32" || $variant == "X32" ]]; then
334 art_debugee="$art_debugee --32"
335 elif [[ $variant == "x64" || $variant == "X64" ]]; then
336 art_debugee="$art_debugee --64"
337 else
338 echo "Error, do not understand variant $variant_cmdline_parameter."
339 exit 1
340 fi
341fi
342
Nicolas Geoffray95186552015-10-28 13:06:21 +0000343if [[ "$image" != "" ]]; then
Alex Light617c9c52017-08-18 11:52:25 -0700344 vm_args="$vm_args --vm-arg $image"
Vladimir Marko91f10322018-12-07 18:04:10 +0000345 debuggee_args="$debuggee_args $image"
346fi
347if [[ "$boot_classpath" != "" ]]; then
348 vm_args="$vm_args --vm-arg -Xbootclasspath:${boot_classpath}"
349 debuggee_args="$debuggee_args -Xbootclasspath:${boot_classpath}"
350fi
351if [[ "$boot_classpath_locations" != "" ]]; then
352 vm_args="$vm_args --vm-arg -Xbootclasspath-locations:${boot_classpath_locations}"
353 debuggee_args="$debuggee_args -Xbootclasspath-locations:${boot_classpath_locations}"
Nicolas Geoffray95186552015-10-28 13:06:21 +0000354fi
Alex Light617c9c52017-08-18 11:52:25 -0700355
356if [[ "$plugin" != "" ]]; then
357 vm_args="$vm_args --vm-arg $plugin"
358fi
359
Alex Light617c9c52017-08-18 11:52:25 -0700360if [[ $mode != "ri" ]]; then
Andreas Gampe817dc662018-09-25 18:08:52 -0700361 # Because we're running debuggable, we discard any AOT code.
362 # Therefore we run de2oat with 'quicken' to avoid spending time compiling.
363 vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken"
364 debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken"
365
366 if $instant_jit; then
367 debuggee_args="$debuggee_args -Xjitthreshold:0"
368 fi
369
Alex Light617c9c52017-08-18 11:52:25 -0700370 vm_args="$vm_args --vm-arg -Xusejit:$use_jit"
371 debuggee_args="$debuggee_args -Xusejit:$use_jit"
372fi
373
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100374if [[ $debug == "yes" ]]; then
375 art="$art -d"
376 art_debugee="$art_debugee -d"
Andreas Gampe1c5b42f2017-06-15 18:20:45 -0700377 vm_args="$vm_args --vm-arg -XXlib:libartd.so --vm-arg -XX:SlowDebug=true"
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100378fi
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200379if [[ $verbose == "yes" ]]; then
380 # Enable JDWP logs in the debuggee.
381 art_debugee="$art_debugee -verbose:jdwp"
382fi
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100383
Neil Fuller239bdf62018-01-08 18:55:36 +0000384if [[ $mode != "ri" ]]; then
Neil Fullerc546ec92018-01-05 15:00:35 +0000385 toolchain_args="--toolchain d8 --language CUR"
Alex Light264a4862018-01-31 16:47:58 +0000386 if [[ "x$with_jdwp_path" == "x" ]]; then
387 # Need to enable the internal jdwp implementation.
388 art_debugee="${art_debugee} -XjdwpProvider:internal"
Alex Lightbaac7e42018-06-08 15:30:11 +0000389 else
390 # need to disable the jdwpProvider since we give the agent explicitly on the
391 # cmdline.
392 art_debugee="${art_debugee} -XjdwpProvider:none"
Alex Light264a4862018-01-31 16:47:58 +0000393 fi
Alex Light8d8299d2017-11-10 08:41:04 -0800394else
395 toolchain_args="--toolchain javac --language CUR"
Igor Murashkin84f26322017-06-06 11:36:33 -0700396fi
397
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000398# Run the tests using vogar.
Nicolas Geoffrayd06dc9c2015-03-30 15:30:26 +0100399vogar $vm_command \
Nicolas Geoffray9648a632015-06-15 14:35:01 +0100400 $vm_args \
Nicolas Geoffray9620b9d2015-03-30 12:28:26 +0100401 --verbose \
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000402 $args \
Roland Levillain08f7c1d2018-05-25 15:34:41 +0100403 $chroot_option \
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000404 $device_dir \
Nicolas Geoffraya2c18612015-03-30 23:01:28 +0100405 $image_compiler_option \
Nicolas Geoffray472b00c2015-05-06 14:57:09 +0100406 --timeout 800 \
Nicolas Geoffray96cd87a2015-03-26 16:48:29 +0000407 --vm-arg -Djpda.settings.verbose=true \
Sebastien Hertzc3b208c2017-03-27 11:35:54 +0200408 --vm-arg -Djpda.settings.timeout=$jdwp_test_timeout \
409 --vm-arg -Djpda.settings.waitingTime=$jdwp_test_timeout \
Nicolas Geoffraya2c18612015-03-30 23:01:28 +0100410 --vm-arg -Djpda.settings.transportAddress=127.0.0.1:55107 \
Alex Light878f33f2018-02-08 11:16:39 -0800411 --vm-arg -Djpda.settings.dumpProcess="$dump_command" \
Vladimir Marko91f10322018-12-07 18:04:10 +0000412 --vm-arg -Djpda.settings.debuggeeJavaPath="$art_debugee $plugin $debuggee_args" \
Igor Murashkin84f26322017-06-06 11:36:33 -0700413 --classpath "$test_jar" \
414 $toolchain_args \
Sebastien Hertza646aaf2015-09-10 12:03:51 +0200415 $test
Hiroshi Yamauchia166bbb2015-11-19 16:24:31 -0800416
417vogar_exit_status=$?
418
419echo "Killing stalled dalvikvm processes..."
Alex Lightc611ffa2017-10-18 08:59:16 -0700420if [[ $mode == "host" ]]; then
Hiroshi Yamauchia166bbb2015-11-19 16:24:31 -0800421 pkill -9 -f /bin/dalvikvm
422else
Orion Hodsoncfb4ed52018-05-22 10:48:52 +0100423 # Tests may run on older Android versions where pkill requires "-l SIGNAL"
424 # rather than "-SIGNAL".
425 adb shell pkill -l 9 -f /bin/dalvikvm
Hiroshi Yamauchia166bbb2015-11-19 16:24:31 -0800426fi
427echo "Done."
428
429exit $vogar_exit_status