blob: e116facd98b31c37bb5666fad02d5d822a6234c8 [file] [log] [blame]
Alex Light646ec0c2017-10-30 16:54:02 -07001#!/bin/bash
2#
3# Copyright (C) 2017 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
22if [[ `uname` != 'Linux' ]]; then
23 echo "Script cannot be run on $(uname). It is Linux only."
24 exit 2
25fi
26
27args=("$@")
28debug="no"
29has_variant="no"
30has_mode="no"
31mode="target"
Alex Lightec4a10c2017-11-17 09:06:26 -080032has_timeout="no"
Alex Light646ec0c2017-10-30 16:54:02 -070033
34while true; do
35 if [[ $1 == "--debug" ]]; then
36 debug="yes"
37 shift
Alex Lightec4a10c2017-11-17 09:06:26 -080038 elif [[ $1 == --test-timeout-ms ]]; then
39 has_timeout="yes"
40 shift
41 shift
Alex Light646ec0c2017-10-30 16:54:02 -070042 elif [[ "$1" == "--mode=jvm" ]]; then
43 has_mode="yes"
44 mode="ri"
45 shift
46 elif [[ "$1" == --mode=host ]]; then
47 has_mode="yes"
48 mode="host"
49 shift
50 elif [[ $1 == --variant=* ]]; then
51 has_variant="yes"
52 shift
53 elif [[ "$1" == "" ]]; then
54 break
55 else
56 shift
57 fi
58done
59
60if [[ "$has_mode" = "no" ]]; then
61 args+=(--mode=device)
62fi
63
64if [[ "$has_variant" = "no" ]]; then
65 args+=(--variant=X32)
66fi
67
Alex Lightec4a10c2017-11-17 09:06:26 -080068if [[ "$has_timeout" = "no" ]]; then
69 # Double the timeout to 20 seconds
70 args+=(--test-timeout-ms)
71 args+=(20000)
72fi
73
Alex Light646ec0c2017-10-30 16:54:02 -070074# We don't use full paths since it is difficult to determine them for device
75# tests and not needed due to resolution rules of dlopen.
76if [[ "$debug" = "yes" ]]; then
77 args+=(-Xplugin:libopenjdkjvmtid.so)
78else
79 args+=(-Xplugin:libopenjdkjvmti.so)
80fi
81
Alex Lighte4f220d2017-12-13 10:13:50 -080082expect_path=$PWD/art/tools/external_oj_libjdwp_art_failures.txt
Alex Light646ec0c2017-10-30 16:54:02 -070083function verbose_run() {
84 echo "$@"
85 env "$@"
86}
87
88verbose_run ./art/tools/run-jdwp-tests.sh \
89 "${args[@]}" \
90 --jdwp-path "libjdwp.so" \
91 --expectations "$expect_path"