1 #!/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 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 22 if [[ `uname` != 'Linux' ]]; then 23 echo "Script cannot be run on $(uname). It is Linux only." 24 exit 2 25 fi 26 27 args=("$@") 28 debug="no" 29 has_variant="no" 30 has_mode="no" 31 mode="target" 32 has_timeout="no" 33 34 while true; do 35 if [[ $1 == "--debug" ]]; then 36 debug="yes" 37 shift 38 elif [[ $1 == --test-timeout-ms ]]; then 39 has_timeout="yes" 40 shift 41 shift 42 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 58 done 59 60 if [[ "$has_mode" = "no" ]]; then 61 args+=(--mode=device) 62 fi 63 64 if [[ "$has_variant" = "no" ]]; then 65 args+=(--variant=X32) 66 fi 67 68 if [[ "$has_timeout" = "no" ]]; then 69 # Double the timeout to 20 seconds 70 args+=(--test-timeout-ms) 71 args+=(20000) 72 fi 73 74 # 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. 76 if [[ "$debug" = "yes" ]]; then 77 args+=(-Xplugin:libopenjdkjvmtid.so) 78 else 79 args+=(-Xplugin:libopenjdkjvmti.so) 80 fi 81 82 expect_path=$PWD/art/tools/external_oj_libjdwp_art_failures.txt 83 function verbose_run() { 84 echo "$@" 85 env "$@" 86 } 87 88 verbose_run ./art/tools/run-jdwp-tests.sh \ 89 "${args[@]}" \ 90 --jdwp-path "libjdwp.so" \ 91 --expectations "$expect_path" 92