blob: c51bd20dd6d5b429541417e271afc5b69ca6835a [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
22# Jar containing all the tests.
23test_jar=out/host/linux-x86/framework/apache-harmony-jdwp-tests-hostdex.jar
24junit_jar=out/host/linux-x86/framework/junit.jar
25
26if [ ! -f $test_jar -o ! -f $junit_jar ]; then
27 echo "Before running, you must build jdwp tests and vogar:" \
28 "make junit apache-harmony-jdwp-tests-hostdex vogar vogar.jar"
29 exit 1
30fi
31
32art="/data/local/tmp/system/bin/art"
33# We use Quick's image on target because optimizing's image is not compiled debuggable.
34image="-Ximage:/data/art-test/core.art"
35args=$@
36debuggee_args="-Xcompiler-option --compiler-backend=Optimizing -Xcompiler-option --debuggable"
37device_dir="--device-dir=/data/local/tmp"
38
39while true; do
40 if [[ "$1" == "--mode=host" ]]; then
41 art="art"
42 # We force generation of a new image to avoid build-time and run-time classpath differences.
43 image="-Ximage:/system/non/existent"
44 device_dir=""
45 shift
46 elif [[ $1 == -Ximage:* ]]; then
47 image="$1"
48 shift
49 elif [[ "$1" == "" ]]; then
50 break
51 else
52 shift
53 fi
54done
55
56# Run the tests using vogar.
57vogar --vm-command=$art \
58 --vm-arg $image \
59 $args \
60 $device_dir \
61 --vm-arg -Ximage-compiler-option \
62 --vm-arg --debuggable \
63 --timeout 600 \
64 --vm-arg -Djpda.settings.verbose=true \
65 --vm-arg -Djpda.settings.syncPort=34016 \
66 --vm-arg -Djpda.settings.debuggeeJavaPath="$art $image $debuggee_args" \
67 --classpath $test_jar \
68 --classpath $junit_jar \
69 --vm-arg -Xcompiler-option --vm-arg --compiler-backend=Optimizing \
70 --vm-arg -Xcompiler-option --vm-arg --debuggable \
71 org.apache.harmony.jpda.tests.share.AllTests