Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Runner for an individual run-test. |
| 4 | |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 5 | if [[ -z "$ANDROID_BUILD_TOP" ]]; then |
| 6 | echo 'ANDROID_BUILD_TOP environment variable is empty; did you forget to run `lunch`?' |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 10 | msg() { |
| 11 | if [ "$QUIET" = "n" ]; then |
| 12 | echo "$@" |
| 13 | fi |
| 14 | } |
| 15 | |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 16 | ANDROID_ROOT="/system" |
Neil Fuller | 26c4377 | 2018-11-23 17:56:43 +0000 | [diff] [blame] | 17 | ANDROID_RUNTIME_ROOT="/apex/com.android.runtime" |
Neil Fuller | 26a5dd6 | 2019-03-13 15:16:35 +0000 | [diff] [blame] | 18 | ANDROID_TZDATA_ROOT="/apex/com.android.tzdata" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 19 | ARCHITECTURES_32="(arm|x86|mips|none)" |
Andreas Gampe | 1a5c406 | 2015-01-15 12:10:47 -0800 | [diff] [blame] | 20 | ARCHITECTURES_64="(arm64|x86_64|mips64|none)" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 21 | ARCHITECTURES_PATTERN="${ARCHITECTURES_32}" |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 22 | GET_DEVICE_ISA_BITNESS_FLAG="--32" |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 23 | BOOT_IMAGE="" |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 24 | CHROOT= |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 25 | COMPILE_FLAGS="" |
| 26 | DALVIKVM="dalvikvm32" |
| 27 | DEBUGGER="n" |
Alex Light | 54dabfb | 2018-09-19 16:29:09 -0700 | [diff] [blame] | 28 | WITH_AGENT=() |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 29 | DEBUGGER_AGENT="" |
| 30 | WRAP_DEBUGGER_AGENT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 31 | DEV_MODE="n" |
Alex Light | 907001d | 2019-01-17 00:16:04 +0000 | [diff] [blame] | 32 | DEX2OAT_NDEBUG_BINARY="dex2oat" |
| 33 | DEX2OAT_DEBUG_BINARY="dex2oatd" |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 34 | EXPERIMENTAL="" |
Nicolas Geoffray | 90355fe | 2017-02-20 09:25:40 +0000 | [diff] [blame] | 35 | FALSE_BIN="false" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 36 | FLAGS="" |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 37 | ANDROID_FLAGS="" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 38 | GDB="" |
Nicolas Geoffray | baf9102 | 2014-10-08 09:56:45 +0100 | [diff] [blame] | 39 | GDB_ARGS="" |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 40 | GDBSERVER_DEVICE="gdbserver" |
| 41 | GDBSERVER_HOST="gdbserver" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 42 | HAVE_IMAGE="y" |
| 43 | HOST="n" |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 44 | BIONIC="n" |
| 45 | CREATE_ANDROID_ROOT="n" |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 46 | USE_ZIPAPEX="n" |
| 47 | ZIPAPEX_LOC="" |
Alex Light | 6f342dd | 2019-03-27 17:15:42 +0000 | [diff] [blame] | 48 | USE_EXTRACTED_ZIPAPEX="n" |
| 49 | EXTRACTED_ZIPAPEX_LOC="" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 50 | INTERPRETER="n" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 51 | JIT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 52 | INVOKE_WITH="" |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 53 | IS_JVMTI_TEST="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 54 | ISA=x86 |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 55 | LIBRARY_DIRECTORY="lib" |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 56 | TEST_DIRECTORY="nativetest" |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 57 | MAIN="" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 58 | OPTIMIZE="y" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 59 | PREBUILD="y" |
| 60 | QUIET="n" |
Nicolas Geoffray | 94e25db | 2017-01-27 14:54:28 +0000 | [diff] [blame] | 61 | RELOCATE="n" |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 62 | STRIP_DEX="n" |
Jeff Hao | 207a37d | 2014-10-29 17:24:25 -0700 | [diff] [blame] | 63 | SECONDARY_DEX="" |
Andreas Gampe | 5212552 | 2019-06-11 14:04:49 -0700 | [diff] [blame] | 64 | TIME_OUT="timeout" # "n" (disabled), "timeout" (use timeout), "gdb" (use gdb) |
Andreas Gampe | 148c160 | 2019-06-10 16:47:46 -0700 | [diff] [blame] | 65 | TIMEOUT_DUMPER=signal_dumper |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 66 | # Value in seconds |
Hiroshi Yamauchi | fd3161a | 2017-01-18 14:47:25 -0800 | [diff] [blame] | 67 | if [ "$ART_USE_READ_BARRIER" != "false" ]; then |
Hiroshi Yamauchi | a9b296c | 2016-10-07 17:07:03 -0700 | [diff] [blame] | 68 | TIME_OUT_VALUE=2400 # 40 minutes. |
Hiroshi Yamauchi | dcf0d4b | 2015-09-09 18:59:42 -0700 | [diff] [blame] | 69 | else |
Mathieu Chartier | 2576be2 | 2016-05-24 10:24:53 -0700 | [diff] [blame] | 70 | TIME_OUT_VALUE=1200 # 20 minutes. |
Hiroshi Yamauchi | dcf0d4b | 2015-09-09 18:59:42 -0700 | [diff] [blame] | 71 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 72 | USE_GDB="n" |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 73 | USE_GDBSERVER="n" |
| 74 | GDBSERVER_PORT=":5039" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 75 | USE_JVM="n" |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 76 | USE_JVMTI="n" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 77 | VERIFY="y" # y=yes,n=no,s=softfail |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 78 | ZYGOTE="" |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 79 | DEX_VERIFY="" |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 80 | INSTRUCTION_SET_FEATURES="" |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 81 | ARGS="" |
David Brazdil | feb2282 | 2019-02-13 21:25:57 +0000 | [diff] [blame] | 82 | VDEX_ARGS="" |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 83 | EXTERNAL_LOG_TAGS="n" # if y respect externally set ANDROID_LOG_TAGS. |
| 84 | DRY_RUN="n" # if y prepare to run the test but don't run it. |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 85 | TEST_VDEX="n" |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 86 | TEST_DM="n" |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 87 | TEST_IS_NDEBUG="n" |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 88 | APP_IMAGE="y" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 89 | JVMTI_STRESS="n" |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 90 | JVMTI_STEP_STRESS="n" |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 91 | JVMTI_FIELD_STRESS="n" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 92 | JVMTI_TRACE_STRESS="n" |
| 93 | JVMTI_REDEFINE_STRESS="n" |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 94 | PROFILE="n" |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 95 | RANDOM_PROFILE="n" |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 96 | # The normal dex2oat timeout. |
Shubham Ajmera | f97cbd6 | 2017-10-11 10:00:57 -0700 | [diff] [blame] | 97 | DEX2OAT_TIMEOUT="300" # 5 mins |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 98 | # The *hard* timeout where we really start trying to kill the dex2oat. |
Shubham Ajmera | f97cbd6 | 2017-10-11 10:00:57 -0700 | [diff] [blame] | 99 | DEX2OAT_RT_TIMEOUT="360" # 6 mins |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 100 | |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 101 | # if "y", run 'sync' before dalvikvm to make sure all files from |
| 102 | # build step (e.g. dex2oat) were finished writing. |
| 103 | SYNC_BEFORE_RUN="n" |
| 104 | |
Andreas Gampe | 1c5b42f | 2017-06-15 18:20:45 -0700 | [diff] [blame] | 105 | # When running a debug build, we want to run with all checks. |
| 106 | ANDROID_FLAGS="${ANDROID_FLAGS} -XX:SlowDebug=true" |
Andreas Gampe | e8f74ca | 2018-01-02 09:26:16 -0800 | [diff] [blame] | 107 | # The same for dex2oatd, both prebuild and runtime-driven. |
| 108 | ANDROID_FLAGS="${ANDROID_FLAGS} -Xcompiler-option --runtime-arg -Xcompiler-option -XX:SlowDebug=true" |
| 109 | COMPILER_FLAGS="${COMPILER_FLAGS} --runtime-arg -XX:SlowDebug=true" |
Andreas Gampe | 1c5b42f | 2017-06-15 18:20:45 -0700 | [diff] [blame] | 110 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 111 | while true; do |
| 112 | if [ "x$1" = "x--quiet" ]; then |
| 113 | QUIET="y" |
| 114 | shift |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 115 | elif [ "x$1" = "x--dex2oat-rt-timeout" ]; then |
| 116 | shift |
| 117 | if [ "x$1" = "x" ]; then |
| 118 | echo "$0 missing argument to --dex2oat-rt-timeout" 1>&2 |
| 119 | exit 1 |
| 120 | fi |
| 121 | DEX2OAT_RT_TIMEOUT="$1" |
| 122 | shift |
| 123 | elif [ "x$1" = "x--dex2oat-timeout" ]; then |
| 124 | shift |
| 125 | if [ "x$1" = "x" ]; then |
| 126 | echo "$0 missing argument to --dex2oat-timeout" 1>&2 |
| 127 | exit 1 |
| 128 | fi |
| 129 | DEX2OAT_TIMEOUT="$1" |
| 130 | shift |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 131 | elif [ "x$1" = "x--jvmti" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 132 | USE_JVMTI="y" |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 133 | IS_JVMTI_TEST="y" |
| 134 | shift |
Alex Light | faf90b6 | 2016-08-12 14:43:48 -0700 | [diff] [blame] | 135 | elif [ "x$1" = "x-O" ]; then |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 136 | TEST_IS_NDEBUG="y" |
Alex Light | faf90b6 | 2016-08-12 14:43:48 -0700 | [diff] [blame] | 137 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 138 | elif [ "x$1" = "x--lib" ]; then |
| 139 | shift |
| 140 | if [ "x$1" = "x" ]; then |
| 141 | echo "$0 missing argument to --lib" 1>&2 |
| 142 | exit 1 |
| 143 | fi |
| 144 | LIB="$1" |
| 145 | shift |
Alex Light | 97acf19 | 2016-03-17 09:59:38 -0700 | [diff] [blame] | 146 | elif [ "x$1" = "x--gc-stress" ]; then |
| 147 | # Give an extra 5 mins if we are gc-stress. |
| 148 | TIME_OUT_VALUE=$((${TIME_OUT_VALUE} + 300)) |
| 149 | shift |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 150 | elif [ "x$1" = "x--testlib" ]; then |
| 151 | shift |
| 152 | if [ "x$1" = "x" ]; then |
| 153 | echo "$0 missing argument to --testlib" 1>&2 |
| 154 | exit 1 |
| 155 | fi |
Mathieu Chartier | de286fd | 2015-09-03 18:10:29 -0700 | [diff] [blame] | 156 | ARGS="${ARGS} $1" |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 157 | shift |
David Srbecky | 5288611 | 2016-01-22 13:56:47 +0000 | [diff] [blame] | 158 | elif [ "x$1" = "x--args" ]; then |
| 159 | shift |
| 160 | if [ "x$1" = "x" ]; then |
| 161 | echo "$0 missing argument to --args" 1>&2 |
| 162 | exit 1 |
| 163 | fi |
| 164 | ARGS="${ARGS} $1" |
| 165 | shift |
Alex Light | e2ddce3 | 2019-05-22 17:08:35 +0000 | [diff] [blame] | 166 | elif [ "x$1" = "x--compiler-only-option" ]; then |
| 167 | shift |
| 168 | option="$1" |
| 169 | COMPILE_FLAGS="${COMPILE_FLAGS} $option" |
| 170 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 171 | elif [ "x$1" = "x-Xcompiler-option" ]; then |
| 172 | shift |
| 173 | option="$1" |
| 174 | FLAGS="${FLAGS} -Xcompiler-option $option" |
| 175 | COMPILE_FLAGS="${COMPILE_FLAGS} $option" |
| 176 | shift |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 177 | elif [ "x$1" = "x--android-runtime-option" ]; then |
| 178 | shift |
| 179 | option="$1" |
| 180 | ANDROID_FLAGS="${ANDROID_FLAGS} $option" |
| 181 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 182 | elif [ "x$1" = "x--runtime-option" ]; then |
| 183 | shift |
| 184 | option="$1" |
| 185 | FLAGS="${FLAGS} $option" |
| 186 | shift |
| 187 | elif [ "x$1" = "x--boot" ]; then |
| 188 | shift |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 189 | BOOT_IMAGE="$1" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 190 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 191 | elif [ "x$1" = "x--relocate" ]; then |
| 192 | RELOCATE="y" |
| 193 | shift |
| 194 | elif [ "x$1" = "x--no-relocate" ]; then |
| 195 | RELOCATE="n" |
| 196 | shift |
| 197 | elif [ "x$1" = "x--prebuild" ]; then |
| 198 | PREBUILD="y" |
| 199 | shift |
Mathieu Chartier | dcd56c9 | 2017-11-20 20:30:24 -0800 | [diff] [blame] | 200 | elif [ "x$1" = "x--compact-dex-level" ]; then |
| 201 | shift |
| 202 | COMPILE_FLAGS="${COMPILE_FLAGS} --compact-dex-level=$1" |
| 203 | shift |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 204 | elif [ "x$1" = "x--jvmti-redefine-stress" ]; then |
| 205 | # APP_IMAGE doesn't really work with jvmti redefine stress |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 206 | USE_JVMTI="y" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 207 | APP_IMAGE="n" |
| 208 | JVMTI_STRESS="y" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 209 | JVMTI_REDEFINE_STRESS="y" |
| 210 | shift |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 211 | elif [ "x$1" = "x--jvmti-step-stress" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 212 | USE_JVMTI="y" |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 213 | JVMTI_STRESS="y" |
| 214 | JVMTI_STEP_STRESS="y" |
| 215 | shift |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 216 | elif [ "x$1" = "x--jvmti-field-stress" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 217 | USE_JVMTI="y" |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 218 | JVMTI_STRESS="y" |
| 219 | JVMTI_FIELD_STRESS="y" |
| 220 | shift |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 221 | elif [ "x$1" = "x--jvmti-trace-stress" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 222 | USE_JVMTI="y" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 223 | JVMTI_STRESS="y" |
| 224 | JVMTI_TRACE_STRESS="y" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 225 | shift |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 226 | elif [ "x$1" = "x--no-app-image" ]; then |
| 227 | APP_IMAGE="n" |
| 228 | shift |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 229 | elif [ "x$1" = "x--strip-dex" ]; then |
| 230 | STRIP_DEX="y" |
| 231 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 232 | elif [ "x$1" = "x--host" ]; then |
| 233 | HOST="y" |
Neil Fuller | 26c4377 | 2018-11-23 17:56:43 +0000 | [diff] [blame] | 234 | ANDROID_ROOT="${ANDROID_HOST_OUT}" |
| 235 | ANDROID_RUNTIME_ROOT="${ANDROID_HOST_OUT}/com.android.runtime" |
Neil Fuller | 26a5dd6 | 2019-03-13 15:16:35 +0000 | [diff] [blame] | 236 | ANDROID_TZDATA_ROOT="${ANDROID_HOST_OUT}/com.android.tzdata" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 237 | shift |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 238 | elif [ "x$1" = "x--bionic" ]; then |
| 239 | BIONIC="y" |
| 240 | # We need to create an ANDROID_ROOT because currently we cannot create |
| 241 | # the frameworks/libcore with linux_bionic so we need to use the normal |
| 242 | # host ones which are in a different location. |
| 243 | CREATE_ANDROID_ROOT="y" |
| 244 | shift |
Alex Light | 6f342dd | 2019-03-27 17:15:42 +0000 | [diff] [blame] | 245 | elif [ "x$1" = "x--runtime-extracted-zipapex" ]; then |
| 246 | shift |
| 247 | USE_EXTRACTED_ZIPAPEX="y" |
| 248 | EXTRACTED_ZIPAPEX_LOC="$1" |
| 249 | shift |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 250 | elif [ "x$1" = "x--runtime-zipapex" ]; then |
| 251 | shift |
| 252 | USE_ZIPAPEX="y" |
| 253 | ZIPAPEX_LOC="$1" |
Alex Light | 907001d | 2019-01-17 00:16:04 +0000 | [diff] [blame] | 254 | # TODO (b/119942078): Currently apex does not support |
| 255 | # symlink_preferred_arch so we will not have a dex2oatd to execute and |
| 256 | # need to manually provide |
| 257 | # dex2oatd64. |
| 258 | DEX2OAT_DEBUG_BINARY="dex2oatd64" |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 259 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 260 | elif [ "x$1" = "x--no-prebuild" ]; then |
| 261 | PREBUILD="n" |
| 262 | shift |
| 263 | elif [ "x$1" = "x--no-image" ]; then |
| 264 | HAVE_IMAGE="n" |
| 265 | shift |
Jeff Hao | 207a37d | 2014-10-29 17:24:25 -0700 | [diff] [blame] | 266 | elif [ "x$1" = "x--secondary" ]; then |
| 267 | SECONDARY_DEX=":$DEX_LOCATION/$TEST_NAME-ex.jar" |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 268 | # Enable cfg-append to make sure we get the dump for both dex files. |
| 269 | # (otherwise the runtime compilation of the secondary dex will overwrite |
Roland Levillain | b0103ca | 2016-11-01 14:48:47 +0000 | [diff] [blame] | 270 | # the dump of the first one). |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 271 | FLAGS="${FLAGS} -Xcompiler-option --dump-cfg-append" |
| 272 | COMPILE_FLAGS="${COMPILE_FLAGS} --dump-cfg-append" |
Jeff Hao | 207a37d | 2014-10-29 17:24:25 -0700 | [diff] [blame] | 273 | shift |
Alex Light | 0e151e7 | 2017-10-25 10:50:35 -0700 | [diff] [blame] | 274 | elif [ "x$1" = "x--with-agent" ]; then |
| 275 | shift |
| 276 | USE_JVMTI="y" |
Alex Light | 54dabfb | 2018-09-19 16:29:09 -0700 | [diff] [blame] | 277 | WITH_AGENT+=("$1") |
Alex Light | 0e151e7 | 2017-10-25 10:50:35 -0700 | [diff] [blame] | 278 | shift |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 279 | elif [ "x$1" = "x--debug-wrap-agent" ]; then |
| 280 | WRAP_DEBUGGER_AGENT="y" |
| 281 | shift |
| 282 | elif [ "x$1" = "x--debug-agent" ]; then |
| 283 | shift |
| 284 | DEBUGGER="agent" |
| 285 | USE_JVMTI="y" |
| 286 | DEBUGGER_AGENT="$1" |
| 287 | TIME_OUT="n" |
| 288 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 289 | elif [ "x$1" = "x--debug" ]; then |
| 290 | DEBUGGER="y" |
Brian Carlstrom | 93d6ce5 | 2014-11-04 22:31:35 -0800 | [diff] [blame] | 291 | TIME_OUT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 292 | shift |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 293 | elif [ "x$1" = "x--gdbserver-port" ]; then |
| 294 | shift |
| 295 | GDBSERVER_PORT=$1 |
| 296 | shift |
| 297 | elif [ "x$1" = "x--gdbserver-bin" ]; then |
| 298 | shift |
| 299 | GDBSERVER_HOST=$1 |
| 300 | GDBSERVER_DEVICE=$1 |
| 301 | shift |
| 302 | elif [ "x$1" = "x--gdbserver" ]; then |
| 303 | USE_GDBSERVER="y" |
| 304 | DEV_MODE="y" |
| 305 | TIME_OUT="n" |
| 306 | HOST="y" |
| 307 | ANDROID_ROOT="${ANDROID_HOST_OUT}" |
| 308 | ANDROID_RUNTIME_ROOT="${ANDROID_HOST_OUT}/com.android.runtime" |
Neil Fuller | 26a5dd6 | 2019-03-13 15:16:35 +0000 | [diff] [blame] | 309 | ANDROID_TZDATA_ROOT="${ANDROID_HOST_OUT}/com.android.tzdata" |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 310 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 311 | elif [ "x$1" = "x--gdb" ]; then |
| 312 | USE_GDB="y" |
| 313 | DEV_MODE="y" |
Brian Carlstrom | 93d6ce5 | 2014-11-04 22:31:35 -0800 | [diff] [blame] | 314 | TIME_OUT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 315 | shift |
Mathieu Chartier | c0a8a80 | 2014-10-17 15:58:01 -0700 | [diff] [blame] | 316 | elif [ "x$1" = "x--gdb-arg" ]; then |
| 317 | shift |
| 318 | gdb_arg="$1" |
| 319 | GDB_ARGS="${GDB_ARGS} $gdb_arg" |
| 320 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 321 | elif [ "x$1" = "x--zygote" ]; then |
| 322 | ZYGOTE="-Xzygote" |
| 323 | msg "Spawning from zygote" |
| 324 | shift |
| 325 | elif [ "x$1" = "x--dev" ]; then |
| 326 | DEV_MODE="y" |
| 327 | shift |
| 328 | elif [ "x$1" = "x--interpreter" ]; then |
| 329 | INTERPRETER="y" |
| 330 | shift |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 331 | elif [ "x$1" = "x--jit" ]; then |
| 332 | JIT="y" |
| 333 | shift |
Nicolas Geoffray | acc56ac | 2018-10-09 08:45:24 +0100 | [diff] [blame] | 334 | elif [ "x$1" = "x--baseline" ]; then |
| 335 | FLAGS="${FLAGS} -Xcompiler-option --baseline" |
Nicolas Geoffray | 9b195cc | 2019-04-02 08:29:00 +0100 | [diff] [blame] | 336 | COMPILE_FLAGS="${COMPILE_FLAGS} --baseline" |
Nicolas Geoffray | acc56ac | 2018-10-09 08:45:24 +0100 | [diff] [blame] | 337 | shift |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 338 | elif [ "x$1" = "x--jvm" ]; then |
| 339 | USE_JVM="y" |
| 340 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 341 | elif [ "x$1" = "x--invoke-with" ]; then |
| 342 | shift |
| 343 | if [ "x$1" = "x" ]; then |
| 344 | echo "$0 missing argument to --invoke-with" 1>&2 |
| 345 | exit 1 |
| 346 | fi |
| 347 | if [ "x$INVOKE_WITH" = "x" ]; then |
| 348 | INVOKE_WITH="$1" |
| 349 | else |
| 350 | INVOKE_WITH="$INVOKE_WITH $1" |
| 351 | fi |
| 352 | shift |
| 353 | elif [ "x$1" = "x--no-verify" ]; then |
| 354 | VERIFY="n" |
| 355 | shift |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 356 | elif [ "x$1" = "x--verify-soft-fail" ]; then |
| 357 | VERIFY="s" |
| 358 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 359 | elif [ "x$1" = "x--no-optimize" ]; then |
| 360 | OPTIMIZE="n" |
| 361 | shift |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 362 | elif [ "x$1" = "x--chroot" ]; then |
| 363 | shift |
| 364 | CHROOT="$1" |
| 365 | shift |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 366 | elif [ "x$1" = "x--android-root" ]; then |
| 367 | shift |
| 368 | ANDROID_ROOT="$1" |
| 369 | shift |
Roland Levillain | 2807614 | 2019-01-10 16:39:25 +0000 | [diff] [blame] | 370 | elif [ "x$1" = "x--android-runtime-root" ]; then |
| 371 | shift |
| 372 | ANDROID_RUNTIME_ROOT="$1" |
| 373 | shift |
Neil Fuller | 26a5dd6 | 2019-03-13 15:16:35 +0000 | [diff] [blame] | 374 | elif [ "x$1" = "x--android-tzdata-root" ]; then |
| 375 | shift |
| 376 | ANDROID_TZDATA_ROOT="$1" |
| 377 | shift |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 378 | elif [ "x$1" = "x--instruction-set-features" ]; then |
| 379 | shift |
| 380 | INSTRUCTION_SET_FEATURES="$1" |
| 381 | shift |
Mathieu Chartier | 2576be2 | 2016-05-24 10:24:53 -0700 | [diff] [blame] | 382 | elif [ "x$1" = "x--timeout" ]; then |
| 383 | shift |
| 384 | TIME_OUT_VALUE="$1" |
| 385 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 386 | elif [ "x$1" = "x--" ]; then |
| 387 | shift |
| 388 | break |
| 389 | elif [ "x$1" = "x--64" ]; then |
| 390 | ISA="x86_64" |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 391 | GDBSERVER_DEVICE="gdbserver64" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 392 | DALVIKVM="dalvikvm64" |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 393 | LIBRARY_DIRECTORY="lib64" |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 394 | TEST_DIRECTORY="nativetest64" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 395 | ARCHITECTURES_PATTERN="${ARCHITECTURES_64}" |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 396 | GET_DEVICE_ISA_BITNESS_FLAG="--64" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 397 | shift |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 398 | elif [ "x$1" = "x--experimental" ]; then |
| 399 | if [ "$#" -lt 2 ]; then |
| 400 | echo "missing --experimental option" 1>&2 |
| 401 | exit 1 |
| 402 | fi |
| 403 | EXPERIMENTAL="$EXPERIMENTAL $2" |
| 404 | shift 2 |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 405 | elif [ "x$1" = "x--external-log-tags" ]; then |
| 406 | EXTERNAL_LOG_TAGS="y" |
| 407 | shift |
| 408 | elif [ "x$1" = "x--dry-run" ]; then |
| 409 | DRY_RUN="y" |
| 410 | shift |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 411 | elif [ "x$1" = "x--vdex" ]; then |
| 412 | TEST_VDEX="y" |
| 413 | shift |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 414 | elif [ "x$1" = "x--dm" ]; then |
| 415 | TEST_DM="y" |
| 416 | shift |
Nicolas Geoffray | 7498105 | 2017-01-16 17:54:09 +0000 | [diff] [blame] | 417 | elif [ "x$1" = "x--vdex-filter" ]; then |
| 418 | shift |
| 419 | option="$1" |
David Brazdil | feb2282 | 2019-02-13 21:25:57 +0000 | [diff] [blame] | 420 | VDEX_ARGS="${VDEX_ARGS} --compiler-filter=$option" |
| 421 | shift |
| 422 | elif [ "x$1" = "x--vdex-arg" ]; then |
| 423 | shift |
| 424 | VDEX_ARGS="${VDEX_ARGS} $1" |
Nicolas Geoffray | 7498105 | 2017-01-16 17:54:09 +0000 | [diff] [blame] | 425 | shift |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 426 | elif [ "x$1" = "x--sync" ]; then |
| 427 | SYNC_BEFORE_RUN="y" |
| 428 | shift |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 429 | elif [ "x$1" = "x--profile" ]; then |
| 430 | PROFILE="y" |
| 431 | shift |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 432 | elif [ "x$1" = "x--random-profile" ]; then |
| 433 | RANDOM_PROFILE="y" |
| 434 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 435 | elif expr "x$1" : "x--" >/dev/null 2>&1; then |
| 436 | echo "unknown $0 option: $1" 1>&2 |
| 437 | exit 1 |
| 438 | else |
| 439 | break |
| 440 | fi |
| 441 | done |
| 442 | |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 443 | # The DEX_LOCATION with the chroot prefix, if any. |
| 444 | CHROOT_DEX_LOCATION="$CHROOT$DEX_LOCATION" |
| 445 | |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 446 | # If running on device, determine the ISA of the device. |
| 447 | if [ "$HOST" = "n" ]; then |
| 448 | ISA=$("$ANDROID_BUILD_TOP/art/test/utils/get-device-isa" "$GET_DEVICE_ISA_BITNESS_FLAG") |
| 449 | fi |
| 450 | |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 451 | if [ "$USE_JVM" = "n" ]; then |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 452 | FLAGS="${FLAGS} ${ANDROID_FLAGS}" |
Alex Light | baac7e4 | 2018-06-08 15:30:11 +0000 | [diff] [blame] | 453 | # we don't want to be trying to get adbconnections since the plugin might |
| 454 | # not have been built. |
| 455 | FLAGS="${FLAGS} -XjdwpProvider:none" |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 456 | for feature in ${EXPERIMENTAL}; do |
Alex Light | fa02285 | 2015-10-28 09:13:20 -0700 | [diff] [blame] | 457 | FLAGS="${FLAGS} -Xexperimental:${feature} -Xcompiler-option --runtime-arg -Xcompiler-option -Xexperimental:${feature}" |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 458 | COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xexperimental:${feature}" |
| 459 | done |
| 460 | fi |
| 461 | |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 462 | if [ "$CREATE_ANDROID_ROOT" = "y" ]; then |
| 463 | ANDROID_ROOT=$DEX_LOCATION/android-root |
| 464 | fi |
| 465 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 466 | if [ "x$1" = "x" ] ; then |
| 467 | MAIN="Main" |
| 468 | else |
| 469 | MAIN="$1" |
Andreas Gampe | f2fdc73 | 2014-06-11 08:20:47 -0700 | [diff] [blame] | 470 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 471 | fi |
| 472 | |
| 473 | if [ "$ZYGOTE" = "" ]; then |
| 474 | if [ "$OPTIMIZE" = "y" ]; then |
| 475 | if [ "$VERIFY" = "y" ]; then |
| 476 | DEX_OPTIMIZE="-Xdexopt:verified" |
| 477 | else |
| 478 | DEX_OPTIMIZE="-Xdexopt:all" |
| 479 | fi |
| 480 | msg "Performing optimizations" |
| 481 | else |
| 482 | DEX_OPTIMIZE="-Xdexopt:none" |
| 483 | msg "Skipping optimizations" |
| 484 | fi |
| 485 | |
| 486 | if [ "$VERIFY" = "y" ]; then |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 487 | JVM_VERIFY_ARG="-Xverify:all" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 488 | msg "Performing verification" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 489 | elif [ "$VERIFY" = "s" ]; then |
| 490 | JVM_VERIFY_ARG="Xverify:all" |
| 491 | DEX_VERIFY="-Xverify:softfail" |
| 492 | msg "Forcing verification to be soft fail" |
| 493 | else # VERIFY = "n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 494 | DEX_VERIFY="-Xverify:none" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 495 | JVM_VERIFY_ARG="-Xverify:none" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 496 | msg "Skipping verification" |
| 497 | fi |
| 498 | fi |
| 499 | |
| 500 | msg "------------------------------" |
| 501 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 502 | if [ "$DEBUGGER" = "y" ]; then |
| 503 | # Use this instead for ddms and connect by running 'ddms': |
| 504 | # DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_android_adb,server=y,suspend=y" |
| 505 | # TODO: add a separate --ddms option? |
| 506 | |
| 507 | PORT=12345 |
| 508 | msg "Waiting for jdb to connect:" |
| 509 | if [ "$HOST" = "n" ]; then |
| 510 | msg " adb forward tcp:$PORT tcp:$PORT" |
| 511 | fi |
| 512 | msg " jdb -attach localhost:$PORT" |
Alex Light | 264a486 | 2018-01-31 16:47:58 +0000 | [diff] [blame] | 513 | if [ "$USE_JVM" = "n" ]; then |
| 514 | # TODO We should switch over to using the jvmti agent by default. |
| 515 | # Need to tell the runtime to enable the internal jdwp implementation. |
| 516 | DEBUGGER_OPTS="-XjdwpOptions:transport=dt_socket,address=$PORT,server=y,suspend=y -XjdwpProvider:internal" |
| 517 | else |
| 518 | DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y" |
| 519 | fi |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 520 | elif [ "$DEBUGGER" = "agent" ]; then |
| 521 | PORT=12345 |
| 522 | # TODO Support ddms connection and support target. |
| 523 | if [ "$HOST" = "n" ]; then |
| 524 | echo "--debug-agent not supported yet for target!" |
| 525 | exit 1 |
| 526 | fi |
| 527 | AGENTPATH=${DEBUGGER_AGENT} |
| 528 | if [ "$WRAP_DEBUGGER_AGENT" = "y" ]; then |
| 529 | WRAPPROPS="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}/libwrapagentpropertiesd.so" |
| 530 | if [ "$TEST_IS_NDEBUG" = "y" ]; then |
| 531 | WRAPPROPS="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}/libwrapagentproperties.so" |
| 532 | fi |
| 533 | AGENTPATH="${WRAPPROPS}=${ANDROID_BUILD_TOP}/art/tools/libjdwp-compat.props,${AGENTPATH}" |
| 534 | fi |
| 535 | msg "Connect to localhost:$PORT" |
| 536 | DEBUGGER_OPTS="-agentpath:${AGENTPATH}=transport=dt_socket,address=$PORT,server=y,suspend=y" |
| 537 | fi |
| 538 | |
Alex Light | 54dabfb | 2018-09-19 16:29:09 -0700 | [diff] [blame] | 539 | for agent in "${WITH_AGENT[@]}"; do |
| 540 | FLAGS="${FLAGS} -agentpath:${agent}" |
| 541 | done |
Alex Light | 0e151e7 | 2017-10-25 10:50:35 -0700 | [diff] [blame] | 542 | |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 543 | if [ "$USE_JVMTI" = "y" ]; then |
| 544 | if [ "$USE_JVM" = "n" ]; then |
| 545 | plugin=libopenjdkjvmtid.so |
| 546 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 547 | plugin=libopenjdkjvmti.so |
| 548 | fi |
Alex Light | 2ce6fc8 | 2017-12-18 16:42:36 -0800 | [diff] [blame] | 549 | # We used to add flags here that made the runtime debuggable but that is not |
| 550 | # needed anymore since the plugin can do it for us now. |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 551 | FLAGS="${FLAGS} -Xplugin:${plugin}" |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 552 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 553 | fi |
| 554 | |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 555 | if [ "$IS_JVMTI_TEST" = "y" ]; then |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 556 | agent=libtiagentd.so |
| 557 | lib=tiagentd |
| 558 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 559 | agent=libtiagent.so |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 560 | lib=tiagent |
| 561 | fi |
| 562 | |
| 563 | ARGS="${ARGS} ${lib}" |
| 564 | if [[ "$USE_JVM" = "y" ]]; then |
| 565 | FLAGS="${FLAGS} -agentpath:${ANDROID_HOST_OUT}/nativetest64/${agent}=${TEST_NAME},jvm" |
| 566 | else |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 567 | if [[ "$HOST" = "y" ]]; then |
| 568 | FLAGS="${FLAGS} -agentpath:${agent}=${TEST_NAME},art" |
| 569 | else |
| 570 | # The linker configuration used for dalvikvm(64) in the Runtime APEX |
| 571 | # requires us to pass the full path to the agent to the runtime when |
| 572 | # running on device. |
| 573 | FLAGS="${FLAGS} -agentpath:/data/${TEST_DIRECTORY}/art/${ISA}/${agent}=${TEST_NAME},art" |
| 574 | fi |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 575 | fi |
| 576 | fi |
| 577 | |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 578 | if [[ "$JVMTI_STRESS" = "y" ]]; then |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 579 | agent=libtistressd.so |
| 580 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 581 | agent=libtistress.so |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 582 | fi |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 583 | |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 584 | # Just give it a default start so we can always add ',' to it. |
| 585 | agent_args="jvmti-stress" |
| 586 | if [[ "$JVMTI_REDEFINE_STRESS" = "y" ]]; then |
| 587 | # We really cannot do this on RI so don't both passing it in that case. |
| 588 | if [[ "$USE_JVM" = "n" ]]; then |
Alex Light | ceae954 | 2017-09-07 13:28:00 -0700 | [diff] [blame] | 589 | agent_args="${agent_args},redefine" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 590 | fi |
| 591 | fi |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 592 | if [[ "$JVMTI_FIELD_STRESS" = "y" ]]; then |
| 593 | agent_args="${agent_args},field" |
| 594 | fi |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 595 | if [[ "$JVMTI_STEP_STRESS" = "y" ]]; then |
| 596 | agent_args="${agent_args},step" |
| 597 | fi |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 598 | if [[ "$JVMTI_TRACE_STRESS" = "y" ]]; then |
| 599 | agent_args="${agent_args},trace" |
| 600 | fi |
| 601 | # In the future add onto this; |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 602 | if [[ "$USE_JVM" = "y" ]]; then |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 603 | FLAGS="${FLAGS} -agentpath:${ANDROID_HOST_OUT}/nativetest64/${agent}=${agent_args}" |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 604 | else |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 605 | if [[ "$HOST" = "y" ]]; then |
| 606 | FLAGS="${FLAGS} -agentpath:${agent}=${agent_args}" |
| 607 | else |
| 608 | # The linker configuration used for dalvikvm(64) in the Runtime APEX |
| 609 | # requires us to pass the full path to the agent to the runtime when |
| 610 | # running on device. |
| 611 | FLAGS="${FLAGS} -agentpath:/data/${TEST_DIRECTORY}/art/${ISA}/${agent}=${agent_args}" |
| 612 | fi |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 613 | fi |
| 614 | fi |
| 615 | |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 616 | if [ "$USE_JVM" = "y" ]; then |
Alex Light | 9c20a14 | 2016-08-23 15:05:12 -0700 | [diff] [blame] | 617 | export LD_LIBRARY_PATH=${ANDROID_HOST_OUT}/lib64 |
Alex Light | 47d49b8 | 2017-07-25 14:06:34 -0700 | [diff] [blame] | 618 | # Some jvmti tests are flaky without -Xint on the RI. |
| 619 | if [ "$IS_JVMTI_TEST" = "y" ]; then |
| 620 | FLAGS="${FLAGS} -Xint" |
| 621 | fi |
Mathieu Chartier | a61894d | 2015-04-23 16:32:54 -0700 | [diff] [blame] | 622 | # Xmx is necessary since we don't pass down the ART flags to JVM. |
Vladimir Marko | c5798bf | 2016-12-09 10:20:54 +0000 | [diff] [blame] | 623 | # We pass the classes2 path whether it's used (src-multidex) or not. |
| 624 | cmdline="${JAVA} ${DEBUGGER_OPTS} ${JVM_VERIFY_ARG} -Xmx256m -classpath classes:classes2 ${FLAGS} $MAIN $@ ${ARGS}" |
Andreas Gampe | 3f1dc56 | 2015-05-18 15:52:22 -0700 | [diff] [blame] | 625 | if [ "$DEV_MODE" = "y" ]; then |
| 626 | echo $cmdline |
| 627 | fi |
| 628 | $cmdline |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 629 | exit |
| 630 | fi |
| 631 | |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 632 | # Note: This must start with the CORE_IMG_JARS in Android.common_path.mk |
| 633 | # because that's what we use for compiling the core.art image. |
| 634 | # It may contain additional modules from TEST_CORE_JARS. |
Neil Fuller | b4a70ce | 2018-11-09 15:49:05 +0000 | [diff] [blame] | 635 | bpath_modules="core-oj core-libart okhttp bouncycastle apache-xml conscrypt" |
Vladimir Marko | 7a85e70 | 2018-12-03 18:47:23 +0000 | [diff] [blame] | 636 | if [ "${HOST}" = "y" ]; then |
| 637 | framework="${ANDROID_HOST_OUT}/framework" |
| 638 | if [ "${ANDROID_HOST_OUT:0:${#ANDROID_BUILD_TOP}+1}" = "${ANDROID_BUILD_TOP}/" ]; then |
| 639 | framework_location="${ANDROID_HOST_OUT:${#ANDROID_BUILD_TOP}+1}/framework" |
| 640 | else |
| 641 | echo "error: ANDROID_BUILD_TOP/ is not a prefix of ANDROID_HOST_OUT" |
| 642 | echo "ANDROID_BUILD_TOP=${ANDROID_BUILD_TOP}" |
| 643 | echo "ANDROID_HOST_OUT=${ANDROID_HOST_OUT}" |
| 644 | exit |
| 645 | fi |
| 646 | bpath_suffix="-hostdex" |
| 647 | else |
| 648 | framework="${ANDROID_ROOT}/framework" |
| 649 | framework_location="${ANDROID_ROOT}/framework" |
| 650 | bpath_suffix="-testdex" |
| 651 | fi |
| 652 | bpath="" |
| 653 | bpath_locations="" |
| 654 | bpath_separator="" |
| 655 | for bpath_module in ${bpath_modules}; do |
| 656 | bpath+="${bpath_separator}${framework}/${bpath_module}${bpath_suffix}.jar" |
| 657 | bpath_locations+="${bpath_separator}${framework_location}/${bpath_module}${bpath_suffix}.jar" |
| 658 | bpath_separator=":" |
| 659 | done |
| 660 | # Pass down the bootclasspath |
| 661 | FLAGS="${FLAGS} -Xbootclasspath:${bpath}" |
| 662 | FLAGS="${FLAGS} -Xbootclasspath-locations:${bpath_locations}" |
| 663 | COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xbootclasspath:${bpath}" |
| 664 | COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xbootclasspath-locations:${bpath_locations}" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 665 | |
| 666 | if [ "$HAVE_IMAGE" = "n" ]; then |
Andreas Gampe | 1078d15 | 2017-11-07 18:00:54 -0800 | [diff] [blame] | 667 | # Disable image dex2oat - this will forbid the runtime to patch or compile an image. |
| 668 | FLAGS="${FLAGS} -Xnoimage-dex2oat" |
| 669 | |
| 670 | # We'll abuse a second flag here to test different behavior. If --relocate, use the |
| 671 | # existing image - relocation will fail as patching is disallowed. If --no-relocate, |
| 672 | # pass a non-existent image - compilation will fail as dex2oat is disallowed. |
| 673 | if [ "${RELOCATE}" = "y" ] ; then |
| 674 | DALVIKVM_BOOT_OPT="-Ximage:${BOOT_IMAGE}" |
| 675 | else |
Roland Levillain | ef01222 | 2017-06-21 16:28:06 +0100 | [diff] [blame] | 676 | DALVIKVM_BOOT_OPT="-Ximage:/system/non-existent/core.art" |
Andreas Gampe | 1078d15 | 2017-11-07 18:00:54 -0800 | [diff] [blame] | 677 | fi |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 678 | else |
| 679 | DALVIKVM_BOOT_OPT="-Ximage:${BOOT_IMAGE}" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 680 | fi |
| 681 | |
| 682 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 683 | if [ "$USE_GDB" = "y" ]; then |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 684 | if [ "$USE_GDBSERVER" = "y" ]; then |
| 685 | echo "Cannot pass both --gdb and --gdbserver at the same time!" >&2 |
| 686 | exit 1 |
| 687 | elif [ "$HOST" = "n" ]; then |
| 688 | GDB="$GDBSERVER_DEVICE $GDBSERVER_PORT" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 689 | else |
| 690 | if [ `uname` = "Darwin" ]; then |
| 691 | GDB=lldb |
Mathieu Chartier | c0a8a80 | 2014-10-17 15:58:01 -0700 | [diff] [blame] | 692 | GDB_ARGS="$GDB_ARGS -- $DALVIKVM" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 693 | DALVIKVM= |
| 694 | else |
| 695 | GDB=gdb |
Mathieu Chartier | c0a8a80 | 2014-10-17 15:58:01 -0700 | [diff] [blame] | 696 | GDB_ARGS="$GDB_ARGS --args $DALVIKVM" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 697 | # Enable for Emacs "M-x gdb" support. TODO: allow extra gdb arguments on command line. |
| 698 | # gdbargs="--annotate=3 $gdbargs" |
| 699 | fi |
| 700 | fi |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 701 | elif [ "$USE_GDBSERVER" = "y" ]; then |
| 702 | if [ "$HOST" = "n" ]; then |
| 703 | echo "Cannot use --gdbserver in non-host configs" >&2 |
| 704 | exit 1 |
| 705 | fi |
| 706 | GDB="$GDBSERVER_HOST $GDBSERVER_PORT" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 707 | fi |
| 708 | |
| 709 | if [ "$INTERPRETER" = "y" ]; then |
Nicolas Geoffray | a5ca8eb | 2018-08-24 13:39:13 +0100 | [diff] [blame] | 710 | INT_OPTS="${INT_OPTS} -Xint" |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 711 | if [ "$VERIFY" = "y" ] ; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 712 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=quicken" |
| 713 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=quicken" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 714 | elif [ "$VERIFY" = "s" ]; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 715 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=extract" |
| 716 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=extract" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 717 | DEX_VERIFY="${DEX_VERIFY} -Xverify:softfail" |
| 718 | else # VERIFY = "n" |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 719 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=assume-verified" |
| 720 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=assume-verified" |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 721 | DEX_VERIFY="${DEX_VERIFY} -Xverify:none" |
| 722 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 723 | fi |
| 724 | |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 725 | if [ "$JIT" = "y" ]; then |
Nicolas Geoffray | a5ca8eb | 2018-08-24 13:39:13 +0100 | [diff] [blame] | 726 | INT_OPTS="${INT_OPTS} -Xusejit:true" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 727 | if [ "$VERIFY" = "y" ] ; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 728 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=quicken" |
| 729 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=quicken" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 730 | else |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 731 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=assume-verified" |
| 732 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=assume-verified" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 733 | DEX_VERIFY="${DEX_VERIFY} -Xverify:none" |
| 734 | fi |
Nicolas Geoffray | a5ca8eb | 2018-08-24 13:39:13 +0100 | [diff] [blame] | 735 | else |
| 736 | INT_OPTS="${INT_OPTS} -Xusejit:false" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 737 | fi |
| 738 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 739 | JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni" |
| 740 | |
Richard Uhler | 020c0f3 | 2017-03-14 16:23:17 +0000 | [diff] [blame] | 741 | COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xnorelocate" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 742 | if [ "$RELOCATE" = "y" ]; then |
Richard Uhler | c52f303 | 2017-03-02 13:45:45 +0000 | [diff] [blame] | 743 | FLAGS="${FLAGS} -Xrelocate" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 744 | else |
| 745 | FLAGS="$FLAGS -Xnorelocate" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 746 | fi |
| 747 | |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 748 | if [ "$BIONIC" = "y" ]; then |
| 749 | # This is the location that soong drops linux_bionic builds. Despite being |
| 750 | # called linux_bionic-x86 the build is actually amd64 (x86_64) only. |
| 751 | if [ ! -e "$OUT_DIR/soong/host/linux_bionic-x86" ]; then |
| 752 | echo "linux_bionic-x86 target doesn't seem to have been built!" >&2 |
| 753 | exit 1 |
| 754 | fi |
Andreas Gampe | 148c160 | 2019-06-10 16:47:46 -0700 | [diff] [blame] | 755 | # Set TIMEOUT_DUMPER manually so it works even with apex's |
| 756 | TIMEOUT_DUMPER=$OUT_DIR/soong/host/linux_bionic-x86/bin/signal_dumper |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 757 | fi |
| 758 | |
Wojciech Staszkiewicz | e663653 | 2016-09-23 10:59:55 -0700 | [diff] [blame] | 759 | # Prevent test from silently falling back to interpreter in no-prebuild mode. This happens |
| 760 | # when DEX_LOCATION path is too long, because vdex/odex filename is constructed by taking |
| 761 | # full path to dex, stripping leading '/', appending '@classes.vdex' and changing every |
| 762 | # remaining '/' into '@'. |
| 763 | if [ "$HOST" = "y" ]; then |
| 764 | max_filename_size=$(getconf NAME_MAX $DEX_LOCATION) |
| 765 | else |
Roland Levillain | 2ae376f | 2018-01-30 11:35:11 +0000 | [diff] [blame] | 766 | # There is no getconf on device, fallback to standard value. |
| 767 | # See NAME_MAX in kernel <linux/limits.h> |
Wojciech Staszkiewicz | e663653 | 2016-09-23 10:59:55 -0700 | [diff] [blame] | 768 | max_filename_size=255 |
| 769 | fi |
| 770 | # Compute VDEX_NAME. |
| 771 | DEX_LOCATION_STRIPPED="${DEX_LOCATION#/}" |
| 772 | VDEX_NAME="${DEX_LOCATION_STRIPPED//\//@}@$TEST_NAME.jar@classes.vdex" |
| 773 | if [ ${#VDEX_NAME} -gt $max_filename_size ]; then |
Nicolas Geoffray | bea3e31 | 2017-03-07 09:59:05 +0000 | [diff] [blame] | 774 | echo "Dex location path too long:" |
| 775 | echo "$VDEX_NAME is ${#VDEX_NAME} character long, and the limit is $max_filename_size." |
Wojciech Staszkiewicz | e663653 | 2016-09-23 10:59:55 -0700 | [diff] [blame] | 776 | exit 1 |
| 777 | fi |
| 778 | |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 779 | if [ "$HOST" = "y" ]; then |
| 780 | # On host, run binaries (`dex2oat(d)`, `dalvikvm`, `profman`) from the `bin` |
| 781 | # directory under the "Android Root" (usually `out/host/linux-x86`). |
| 782 | # |
| 783 | # TODO(b/130295968): Adjust this if/when ART host artifacts are installed |
| 784 | # under the Android Runtime Root (usually |
| 785 | # `out/host/linux-x86/com.android.runtime`). |
| 786 | ANDROID_RUNTIME_BIN_DIR=$ANDROID_ROOT/bin |
| 787 | else |
| 788 | # On target, run binaries (`dex2oat(d)`, `dalvikvm`, `profman`) from the |
| 789 | # Runtime APEX's `bin` directory. This means the linker will observe the |
| 790 | # Runtime APEX linker configuration file |
| 791 | # (`/apex/com.android.runtime/etc/ld.config.txt`) for these binaries. |
| 792 | ANDROID_RUNTIME_BIN_DIR=$ANDROID_RUNTIME_ROOT/bin |
| 793 | fi |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 794 | |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 795 | profman_cmdline="true" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 796 | dex2oat_cmdline="true" |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 797 | vdex_cmdline="true" |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 798 | dm_cmdline="true" |
Andreas Gampe | b09abb2 | 2018-05-03 11:51:22 -0700 | [diff] [blame] | 799 | mkdir_locations="${DEX_LOCATION}/dalvik-cache/$ISA" |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 800 | strip_cmdline="true" |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 801 | sync_cmdline="true" |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 802 | linkroot_cmdline="true" |
| 803 | linkroot_overlay_cmdline="true" |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 804 | setupapex_cmdline="true" |
| 805 | installapex_cmdline="true" |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 806 | |
| 807 | linkdirs() { |
| 808 | find "$1" -maxdepth 1 -mindepth 1 -type d | xargs -i ln -sf '{}' "$2" |
| 809 | } |
| 810 | |
| 811 | if [ "$CREATE_ANDROID_ROOT" = "y" ]; then |
| 812 | mkdir_locations="${mkdir_locations} ${ANDROID_ROOT}" |
| 813 | linkroot_cmdline="linkdirs ${ANDROID_HOST_OUT} ${ANDROID_ROOT}" |
| 814 | if [ "${BIONIC}" = "y" ]; then |
| 815 | # TODO Make this overlay more generic. |
| 816 | linkroot_overlay_cmdline="linkdirs $OUT_DIR/soong/host/linux_bionic-x86 ${ANDROID_ROOT}" |
| 817 | fi |
| 818 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 819 | |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 820 | if [ "$USE_ZIPAPEX" = "y" ]; then |
| 821 | # TODO Currently this only works for linux_bionic zipapexes because those are |
| 822 | # stripped and so small enough that the ulimit doesn't kill us. |
| 823 | mkdir_locations="${mkdir_locations} $DEX_LOCATION/zipapex" |
| 824 | zip_options="-qq" |
| 825 | if [ "$DEV_MODE" = "y" ]; then |
| 826 | zip_options="" |
| 827 | fi |
Alex Light | fc52ffc | 2019-01-31 15:48:18 -0800 | [diff] [blame] | 828 | setupapex_cmdline="unzip -o -u ${zip_options} ${ZIPAPEX_LOC} apex_payload.zip -d ${DEX_LOCATION}" |
| 829 | installapex_cmdline="unzip -o -u ${zip_options} ${DEX_LOCATION}/apex_payload.zip -d ${DEX_LOCATION}/zipapex" |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 830 | ANDROID_RUNTIME_BIN_DIR=$DEX_LOCATION/zipapex/bin |
Alex Light | 6f342dd | 2019-03-27 17:15:42 +0000 | [diff] [blame] | 831 | elif [ "$USE_EXTRACTED_ZIPAPEX" = "y" ]; then |
| 832 | # Just symlink the zipapex binaries |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 833 | ANDROID_RUNTIME_BIN_DIR=$DEX_LOCATION/zipapex/bin |
Alex Light | 6f342dd | 2019-03-27 17:15:42 +0000 | [diff] [blame] | 834 | # Force since some tests manually run this file twice. |
| 835 | ln_options="" |
| 836 | if [ "$DEV_MODE" = "y" ]; then |
| 837 | ln_options="--verbose" |
| 838 | fi |
| 839 | installapex_cmdline="ln -s -f ${ln_options} ${EXTRACTED_ZIPAPEX_LOC} ${DEX_LOCATION}/zipapex" |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 840 | fi |
| 841 | |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 842 | # PROFILE takes precedence over RANDOM_PROFILE, since PROFILE tests require a |
| 843 | # specific profile to run properly. |
| 844 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 845 | profman_cmdline="$ANDROID_RUNTIME_BIN_DIR/profman \ |
Nicolas Geoffray | 0b6a638 | 2017-03-10 09:38:35 +0000 | [diff] [blame] | 846 | --apk=$DEX_LOCATION/$TEST_NAME.jar \ |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 847 | --dex-location=$DEX_LOCATION/$TEST_NAME.jar" |
Calin Juravle | 6df62f7 | 2017-04-28 19:58:01 -0700 | [diff] [blame] | 848 | if [ -f $DEX_LOCATION/$TEST_NAME-ex.jar ]; then |
| 849 | profman_cmdline="${profman_cmdline} \ |
| 850 | --apk=$DEX_LOCATION/$TEST_NAME-ex.jar \ |
| 851 | --dex-location=$DEX_LOCATION/$TEST_NAME-ex.jar" |
| 852 | fi |
Nicolas Geoffray | 0b6a638 | 2017-03-10 09:38:35 +0000 | [diff] [blame] | 853 | COMPILE_FLAGS="${COMPILE_FLAGS} --profile-file=$DEX_LOCATION/$TEST_NAME.prof" |
| 854 | FLAGS="${FLAGS} -Xcompiler-option --profile-file=$DEX_LOCATION/$TEST_NAME.prof" |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 855 | if [ "$PROFILE" = "y" ]; then |
| 856 | profman_cmdline="${profman_cmdline} --create-profile-from=$DEX_LOCATION/profile \ |
| 857 | --reference-profile-file=$DEX_LOCATION/$TEST_NAME.prof" |
| 858 | else |
| 859 | profman_cmdline="${profman_cmdline} --generate-test-profile=$DEX_LOCATION/$TEST_NAME.prof \ |
| 860 | --generate-test-profile-seed=0" |
| 861 | fi |
Nicolas Geoffray | 0b6a638 | 2017-03-10 09:38:35 +0000 | [diff] [blame] | 862 | fi |
| 863 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 864 | if [ "$PREBUILD" = "y" ]; then |
Alex Light | afb5d19 | 2016-05-24 15:57:45 -0700 | [diff] [blame] | 865 | mkdir_locations="${mkdir_locations} ${DEX_LOCATION}/oat/$ISA" |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 866 | if [ "$APP_IMAGE" = "y" ]; then |
| 867 | # Pick a base that will force the app image to get relocated. |
Mathieu Chartier | 7cb707f | 2019-03-08 12:58:06 -0800 | [diff] [blame] | 868 | app_image="--base=0x4000 --app-image-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.art --resolve-startup-const-strings=true" |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 869 | fi |
| 870 | |
Alex Light | 907001d | 2019-01-17 00:16:04 +0000 | [diff] [blame] | 871 | dex2oat_binary=${DEX2OAT_DEBUG_BINARY} |
Roland Levillain | 6c3af16 | 2017-04-27 11:18:56 +0100 | [diff] [blame] | 872 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
Alex Light | 907001d | 2019-01-17 00:16:04 +0000 | [diff] [blame] | 873 | dex2oat_binary=${DEX2OAT_NDEBUG_BINARY} |
Roland Levillain | 6c3af16 | 2017-04-27 11:18:56 +0100 | [diff] [blame] | 874 | fi |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 875 | dex2oat_cmdline="$INVOKE_WITH $ANDROID_RUNTIME_BIN_DIR/$dex2oat_binary \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 876 | $COMPILE_FLAGS \ |
Nicolas Geoffray | 68e25eb | 2014-10-29 23:02:11 +0000 | [diff] [blame] | 877 | --boot-image=${BOOT_IMAGE} \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 878 | --dex-file=$DEX_LOCATION/$TEST_NAME.jar \ |
Andreas Gampe | 1475924 | 2016-03-23 10:54:21 -0700 | [diff] [blame] | 879 | --oat-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.odex \ |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 880 | ${app_image} \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 881 | --instruction-set=$ISA" |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 882 | if [ "x$INSTRUCTION_SET_FEATURES" != "x" ] ; then |
| 883 | dex2oat_cmdline="${dex2oat_cmdline} --instruction-set-features=${INSTRUCTION_SET_FEATURES}" |
| 884 | fi |
Andreas Gampe | 2ea7b70 | 2015-08-07 08:07:16 -0700 | [diff] [blame] | 885 | |
| 886 | # Add in a timeout. This is important for testing the compilation/verification time of |
| 887 | # pathological cases. |
| 888 | # Note: as we don't know how decent targets are (e.g., emulator), only do this on the host for |
| 889 | # now. We should try to improve this. |
| 890 | # The current value is rather arbitrary. run-tests should compile quickly. |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 891 | # Watchdog timeout is in milliseconds so add 3 '0's to the dex2oat timeout. |
Andreas Gampe | 2ea7b70 | 2015-08-07 08:07:16 -0700 | [diff] [blame] | 892 | if [ "$HOST" != "n" ]; then |
| 893 | # Use SIGRTMIN+2 to try to dump threads. |
| 894 | # Use -k 1m to SIGKILL it a minute later if it hasn't ended. |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 895 | dex2oat_cmdline="timeout -k ${DEX2OAT_TIMEOUT}s -s SIGRTMIN+2 ${DEX2OAT_RT_TIMEOUT}s ${dex2oat_cmdline} --watchdog-timeout=${DEX2OAT_TIMEOUT}000" |
Andreas Gampe | 2ea7b70 | 2015-08-07 08:07:16 -0700 | [diff] [blame] | 896 | fi |
Nicolas Geoffray | fbc4f11 | 2017-04-27 21:45:35 +0100 | [diff] [blame] | 897 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
David Brazdil | feb2282 | 2019-02-13 21:25:57 +0000 | [diff] [blame] | 898 | vdex_cmdline="${dex2oat_cmdline} ${VDEX_ARGS} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex --output-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex" |
Nicolas Geoffray | fbc4f11 | 2017-04-27 21:45:35 +0100 | [diff] [blame] | 899 | elif [ "$TEST_VDEX" = "y" ]; then |
David Brazdil | feb2282 | 2019-02-13 21:25:57 +0000 | [diff] [blame] | 900 | vdex_cmdline="${dex2oat_cmdline} ${VDEX_ARGS} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex" |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 901 | elif [ "$TEST_DM" = "y" ]; then |
| 902 | dex2oat_cmdline="${dex2oat_cmdline} --output-vdex=$DEX_LOCATION/oat/$ISA/primary.vdex" |
| 903 | dm_cmdline="zip -qj $DEX_LOCATION/oat/$ISA/$TEST_NAME.dm $DEX_LOCATION/oat/$ISA/primary.vdex" |
David Brazdil | feb2282 | 2019-02-13 21:25:57 +0000 | [diff] [blame] | 904 | vdex_cmdline="${dex2oat_cmdline} ${VDEX_ARGS} --dump-timings --dm-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.dm" |
Nicolas Geoffray | cab6557 | 2017-04-21 17:16:44 +0100 | [diff] [blame] | 905 | elif [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
| 906 | vdex_cmdline="${dex2oat_cmdline} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex --output-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex" |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 907 | fi |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 908 | fi |
| 909 | |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 910 | if [ "$STRIP_DEX" = "y" ]; then |
| 911 | strip_cmdline="zip --quiet --delete $DEX_LOCATION/$TEST_NAME.jar classes.dex" |
| 912 | fi |
| 913 | |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 914 | if [ "$SYNC_BEFORE_RUN" = "y" ]; then |
| 915 | sync_cmdline="sync" |
| 916 | fi |
| 917 | |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 918 | DALVIKVM_ISA_FEATURES_ARGS="" |
| 919 | if [ "x$INSTRUCTION_SET_FEATURES" != "x" ] ; then |
| 920 | DALVIKVM_ISA_FEATURES_ARGS="-Xcompiler-option --instruction-set-features=${INSTRUCTION_SET_FEATURES}" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 921 | fi |
| 922 | |
Nicolas Geoffray | c525604 | 2015-12-26 19:41:37 +0000 | [diff] [blame] | 923 | # java.io.tmpdir can only be set at launch time. |
| 924 | TMP_DIR_OPTION="" |
| 925 | if [ "$HOST" = "n" ]; then |
| 926 | TMP_DIR_OPTION="-Djava.io.tmpdir=/data/local/tmp" |
| 927 | fi |
| 928 | |
Nicolas Geoffray | 6ee4971 | 2018-03-30 14:39:05 +0000 | [diff] [blame] | 929 | # We set DumpNativeStackOnSigQuit to false to avoid stressing libunwind. |
| 930 | # b/27185632 |
| 931 | # b/24664297 |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 932 | dalvikvm_cmdline="$INVOKE_WITH $GDB $ANDROID_RUNTIME_BIN_DIR/$DALVIKVM \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 933 | $GDB_ARGS \ |
| 934 | $FLAGS \ |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 935 | $DEX_VERIFY \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 936 | -XXlib:$LIB \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 937 | $DEX2OAT \ |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 938 | $DALVIKVM_ISA_FEATURES_ARGS \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 939 | $ZYGOTE \ |
| 940 | $JNI_OPTS \ |
| 941 | $INT_OPTS \ |
| 942 | $DEBUGGER_OPTS \ |
| 943 | $DALVIKVM_BOOT_OPT \ |
Nicolas Geoffray | c525604 | 2015-12-26 19:41:37 +0000 | [diff] [blame] | 944 | $TMP_DIR_OPTION \ |
Nicolas Geoffray | 6ee4971 | 2018-03-30 14:39:05 +0000 | [diff] [blame] | 945 | -XX:DumpNativeStackOnSigQuit:false \ |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 946 | -cp $DEX_LOCATION/$TEST_NAME.jar$SECONDARY_DEX $MAIN $ARGS" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 947 | |
Andreas Gampe | 3ad5d5e | 2015-02-03 18:26:55 -0800 | [diff] [blame] | 948 | # Remove whitespace. |
| 949 | dex2oat_cmdline=$(echo $dex2oat_cmdline) |
| 950 | dalvikvm_cmdline=$(echo $dalvikvm_cmdline) |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 951 | dm_cmdline=$(echo $dm_cmdline) |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 952 | vdex_cmdline=$(echo $vdex_cmdline) |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 953 | profman_cmdline=$(echo $profman_cmdline) |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 954 | |
Andreas Gampe | b31a8e7 | 2017-05-16 10:30:24 -0700 | [diff] [blame] | 955 | # Use an empty ASAN_OPTIONS to enable defaults. |
| 956 | # Note: this is required as envsetup right now exports detect_leaks=0. |
| 957 | RUN_TEST_ASAN_OPTIONS="" |
| 958 | |
Andreas Gampe | 5840839 | 2017-05-16 10:45:46 -0700 | [diff] [blame] | 959 | # Multiple shutdown leaks. b/38341789 |
| 960 | if [ "x$RUN_TEST_ASAN_OPTIONS" != "x" ] ; then |
| 961 | RUN_TEST_ASAN_OPTIONS="${RUN_TEST_ASAN_OPTIONS}:" |
| 962 | fi |
| 963 | RUN_TEST_ASAN_OPTIONS="${RUN_TEST_ASAN_OPTIONS}detect_leaks=0" |
| 964 | |
Vladimir Marko | a497a39 | 2018-09-26 10:52:50 +0100 | [diff] [blame] | 965 | # For running, we must turn off logging when dex2oat is missing. Otherwise we use |
Nicolas Geoffray | f39f04c | 2018-03-05 15:42:11 +0000 | [diff] [blame] | 966 | # the same defaults as for prebuilt: everything when --dev, otherwise errors and above only. |
| 967 | if [ "$EXTERNAL_LOG_TAGS" = "n" ]; then |
| 968 | if [ "$DEV_MODE" = "y" ]; then |
| 969 | export ANDROID_LOG_TAGS='*:d' |
Nicolas Geoffray | f39f04c | 2018-03-05 15:42:11 +0000 | [diff] [blame] | 970 | elif [ "$HAVE_IMAGE" = "n" ]; then |
| 971 | # All tests would log the error of missing image. Be silent here and only log fatal |
| 972 | # events. |
| 973 | export ANDROID_LOG_TAGS='*:s' |
| 974 | else |
| 975 | # We are interested in LOG(ERROR) output. |
| 976 | export ANDROID_LOG_TAGS='*:e' |
| 977 | fi |
| 978 | fi |
| 979 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 980 | if [ "$HOST" = "n" ]; then |
| 981 | adb root > /dev/null |
| 982 | adb wait-for-device |
| 983 | if [ "$QUIET" = "n" ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 984 | adb shell rm -rf $CHROOT_DEX_LOCATION |
| 985 | adb shell mkdir -p $CHROOT_DEX_LOCATION |
| 986 | adb push $TEST_NAME.jar $CHROOT_DEX_LOCATION |
| 987 | adb push $TEST_NAME-ex.jar $CHROOT_DEX_LOCATION |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 988 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 989 | adb push profile $CHROOT_DEX_LOCATION |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 990 | fi |
David Brazdil | 7d2ec61 | 2018-01-19 14:19:59 +0000 | [diff] [blame] | 991 | # Copy resource folder |
| 992 | if [ -d res ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 993 | adb push res $CHROOT_DEX_LOCATION |
David Brazdil | 7d2ec61 | 2018-01-19 14:19:59 +0000 | [diff] [blame] | 994 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 995 | else |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 996 | adb shell rm -rf $CHROOT_DEX_LOCATION >/dev/null 2>&1 |
| 997 | adb shell mkdir -p $CHROOT_DEX_LOCATION >/dev/null 2>&1 |
| 998 | adb push $TEST_NAME.jar $CHROOT_DEX_LOCATION >/dev/null 2>&1 |
| 999 | adb push $TEST_NAME-ex.jar $CHROOT_DEX_LOCATION >/dev/null 2>&1 |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 1000 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 1001 | adb push profile $CHROOT_DEX_LOCATION >/dev/null 2>&1 |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 1002 | fi |
David Brazdil | 7d2ec61 | 2018-01-19 14:19:59 +0000 | [diff] [blame] | 1003 | # Copy resource folder |
| 1004 | if [ -d res ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 1005 | adb push res $CHROOT_DEX_LOCATION >/dev/null 2>&1 |
David Brazdil | 7d2ec61 | 2018-01-19 14:19:59 +0000 | [diff] [blame] | 1006 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1007 | fi |
| 1008 | |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 1009 | # Populate LD_LIBRARY_PATH. |
| 1010 | LD_LIBRARY_PATH= |
Nicolas Geoffray | eb441dd | 2014-10-31 15:34:50 +0000 | [diff] [blame] | 1011 | if [ "$ANDROID_ROOT" != "/system" ]; then |
| 1012 | # Current default installation is dalvikvm 64bits and dex2oat 32bits, |
| 1013 | # so we can only use LD_LIBRARY_PATH when testing on a local |
| 1014 | # installation. |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 1015 | LD_LIBRARY_PATH="$ANDROID_ROOT/$LIBRARY_DIRECTORY" |
Nicolas Geoffray | eb441dd | 2014-10-31 15:34:50 +0000 | [diff] [blame] | 1016 | fi |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 1017 | # Needed to access libarttest(d).so and JVMTI agent libraries. |
| 1018 | LD_LIBRARY_PATH="/data/$TEST_DIRECTORY/art/$ISA:$LD_LIBRARY_PATH" |
| 1019 | # Needed to access the boot (core) image files. |
| 1020 | LD_LIBRARY_PATH="/data/art-test/$ISA:$LD_LIBRARY_PATH" |
| 1021 | # Needed to access the test's Odex files. |
| 1022 | LD_LIBRARY_PATH="$DEX_LOCATION/oat/$ISA:$LD_LIBRARY_PATH" |
| 1023 | # Needed to access the test's native libraries (see e.g. 674-hiddenapi, |
| 1024 | # which generates `libhiddenapitest_*.so` libraries in `$DEX_LOCATION`). |
| 1025 | LD_LIBRARY_PATH="$DEX_LOCATION:$LD_LIBRARY_PATH" |
Nicolas Geoffray | eb441dd | 2014-10-31 15:34:50 +0000 | [diff] [blame] | 1026 | |
Dimitry Ivanov | 49c2c92 | 2017-02-14 11:06:14 -0800 | [diff] [blame] | 1027 | # System libraries needed by libarttestd.so |
Vladimir Marko | 2da72ed | 2018-03-07 12:58:11 +0000 | [diff] [blame] | 1028 | PUBLIC_LIBS=libc++.so:libbacktrace.so:libbase.so:libnativehelper.so |
| 1029 | if [ "$TEST_IS_NDEBUG" = "y" ]; then |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 1030 | PUBLIC_LIBS=$PUBLIC_LIBS:libart.so:libdexfile.so:libprofile.so:libartbase.so |
Vladimir Marko | 2da72ed | 2018-03-07 12:58:11 +0000 | [diff] [blame] | 1031 | else |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 1032 | PUBLIC_LIBS=$PUBLIC_LIBS:libartd.so:libdexfiled.so:libprofiled.so:libartbased.so |
Vladimir Marko | 2da72ed | 2018-03-07 12:58:11 +0000 | [diff] [blame] | 1033 | fi |
Dimitry Ivanov | 90d48f2 | 2016-05-05 17:24:28 -0700 | [diff] [blame] | 1034 | |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 1035 | # Prepend directories to the path on device. |
| 1036 | PREPEND_TARGET_PATH=$ANDROID_RUNTIME_BIN_DIR |
| 1037 | if [ "$ANDROID_ROOT" != "/system" ]; then |
| 1038 | PREPEND_TARGET_PATH="$PREPEND_TARGET_PATH:$ANDROID_ROOT/bin" |
| 1039 | fi |
| 1040 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1041 | # Create a script with the command. The command can get longer than the longest |
| 1042 | # allowed adb command and there is no way to get the exit status from a adb shell |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 1043 | # command. Dalvik cache is cleaned before running to make subsequent executions |
| 1044 | # of the script follow the same runtime path. |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1045 | cmdline="cd $DEX_LOCATION && \ |
Andreas Gampe | b31a8e7 | 2017-05-16 10:30:24 -0700 | [diff] [blame] | 1046 | export ASAN_OPTIONS=$RUN_TEST_ASAN_OPTIONS && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1047 | export ANDROID_DATA=$DEX_LOCATION && \ |
Dimitry Ivanov | 90d48f2 | 2016-05-05 17:24:28 -0700 | [diff] [blame] | 1048 | export ANDROID_ADDITIONAL_PUBLIC_LIBRARIES=$PUBLIC_LIBS && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1049 | export DEX_LOCATION=$DEX_LOCATION && \ |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 1050 | export ANDROID_ROOT=$ANDROID_ROOT && \ |
Neil Fuller | 26c4377 | 2018-11-23 17:56:43 +0000 | [diff] [blame] | 1051 | export ANDROID_RUNTIME_ROOT=$ANDROID_RUNTIME_ROOT && \ |
Neil Fuller | 26a5dd6 | 2019-03-13 15:16:35 +0000 | [diff] [blame] | 1052 | export ANDROID_TZDATA_ROOT=$ANDROID_TZDATA_ROOT && \ |
Nicolas Geoffray | f39f04c | 2018-03-05 15:42:11 +0000 | [diff] [blame] | 1053 | export ANDROID_LOG_TAGS=$ANDROID_LOG_TAGS && \ |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 1054 | rm -rf ${DEX_LOCATION}/dalvik-cache/ && \ |
Alex Light | afb5d19 | 2016-05-24 15:57:45 -0700 | [diff] [blame] | 1055 | mkdir -p ${mkdir_locations} && \ |
Sebastien Hertz | 7cde48c | 2015-01-20 16:06:43 +0100 | [diff] [blame] | 1056 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH && \ |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 1057 | export PATH=$PREPEND_TARGET_PATH:\$PATH && \ |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 1058 | $profman_cmdline && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1059 | $dex2oat_cmdline && \ |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 1060 | $dm_cmdline && \ |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 1061 | $vdex_cmdline && \ |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 1062 | $strip_cmdline && \ |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 1063 | $sync_cmdline && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1064 | $dalvikvm_cmdline" |
| 1065 | |
| 1066 | cmdfile=$(tempfile -p "cmd-" -s "-$TEST_NAME") |
| 1067 | echo "$cmdline" > $cmdfile |
| 1068 | |
| 1069 | if [ "$DEV_MODE" = "y" ]; then |
| 1070 | echo $cmdline |
| 1071 | fi |
| 1072 | |
| 1073 | if [ "$QUIET" = "n" ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 1074 | adb push $cmdfile $CHROOT_DEX_LOCATION/cmdline.sh |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1075 | else |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 1076 | adb push $cmdfile $CHROOT_DEX_LOCATION/cmdline.sh >/dev/null 2>&1 |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1077 | fi |
| 1078 | |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1079 | exit_status=0 |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 1080 | if [ "$DRY_RUN" != "y" ]; then |
Roland Levillain | 76cfe61 | 2017-10-30 13:14:28 +0000 | [diff] [blame] | 1081 | if [ -n "$CHROOT" ]; then |
| 1082 | adb shell chroot "$CHROOT" sh $DEX_LOCATION/cmdline.sh |
| 1083 | else |
| 1084 | adb shell sh $DEX_LOCATION/cmdline.sh |
| 1085 | fi |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1086 | exit_status=$? |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 1087 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1088 | |
| 1089 | rm -f $cmdfile |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1090 | exit $exit_status |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1091 | else |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 1092 | # Host run. |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1093 | export ANDROID_PRINTF_LOG=brief |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 1094 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1095 | export ANDROID_DATA="$DEX_LOCATION" |
Nicolas Geoffray | 8eedb47 | 2014-10-29 14:05:59 +0000 | [diff] [blame] | 1096 | export ANDROID_ROOT="${ANDROID_ROOT}" |
Neil Fuller | 26c4377 | 2018-11-23 17:56:43 +0000 | [diff] [blame] | 1097 | export ANDROID_RUNTIME_ROOT="${ANDROID_RUNTIME_ROOT}" |
Neil Fuller | 26a5dd6 | 2019-03-13 15:16:35 +0000 | [diff] [blame] | 1098 | export ANDROID_TZDATA_ROOT="${ANDROID_TZDATA_ROOT}" |
Alex Light | 6f342dd | 2019-03-27 17:15:42 +0000 | [diff] [blame] | 1099 | if [ "$USE_ZIPAPEX" = "y" ] || [ "$USE_EXRACTED_ZIPAPEX" = "y" ]; then |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 1100 | # Put the zipapex files in front of the ld-library-path |
Alex Light | f7f3152 | 2019-02-01 11:14:41 -0800 | [diff] [blame] | 1101 | export LD_LIBRARY_PATH="${ANDROID_DATA}/zipapex/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" |
| 1102 | export DYLD_LIBRARY_PATH="${ANDROID_DATA}/zipapex/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" |
| 1103 | else |
| 1104 | export LD_LIBRARY_PATH="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" |
| 1105 | export DYLD_LIBRARY_PATH="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 1106 | fi |
Roland Levillain | 72f6774 | 2019-03-06 15:48:08 +0000 | [diff] [blame] | 1107 | export PATH="$PATH:$ANDROID_RUNTIME_BIN_DIR" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1108 | |
David Srbecky | c9ede38 | 2015-06-20 06:03:53 +0100 | [diff] [blame] | 1109 | # Temporarily disable address space layout randomization (ASLR). |
| 1110 | # This is needed on the host so that the linker loads core.oat at the necessary address. |
| 1111 | export LD_USE_LOAD_BIAS=1 |
| 1112 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1113 | cmdline="$dalvikvm_cmdline" |
| 1114 | |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1115 | if [ "$TIME_OUT" = "gdb" ]; then |
| 1116 | if [ `uname` = "Darwin" ]; then |
| 1117 | # Fall back to timeout on Mac. |
| 1118 | TIME_OUT="timeout" |
Hiroshi Yamauchi | c823eff | 2015-09-01 16:21:35 -0700 | [diff] [blame] | 1119 | elif [ "$ISA" = "x86" ]; then |
| 1120 | # prctl call may fail in 32-bit on an older (3.2) 64-bit Linux kernel. Fall back to timeout. |
| 1121 | TIME_OUT="timeout" |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1122 | else |
| 1123 | # Check if gdb is available. |
| 1124 | gdb --eval-command="quit" > /dev/null 2>&1 |
| 1125 | if [ $? != 0 ]; then |
| 1126 | # gdb isn't available. Fall back to timeout. |
| 1127 | TIME_OUT="timeout" |
| 1128 | fi |
| 1129 | fi |
| 1130 | fi |
| 1131 | |
| 1132 | if [ "$TIME_OUT" = "timeout" ]; then |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1133 | # Add timeout command if time out is desired. |
Andreas Gampe | 038bb22 | 2015-01-13 19:48:14 -0800 | [diff] [blame] | 1134 | # |
Andreas Gampe | 0df2aba | 2019-06-10 16:53:55 -0700 | [diff] [blame] | 1135 | # Note: We first send SIGTERM (the timeout default, signal 15) to the signal dumper, which |
| 1136 | # will induce a full thread dump before killing the process. To ensure any issues in |
| 1137 | # dumping do not lead to a deadlock, we also use the "-k" option to definitely kill the |
| 1138 | # child. |
Andreas Gampe | 4bdcf5d | 2018-12-14 10:48:53 -0800 | [diff] [blame] | 1139 | # Note: Using "--foreground" to not propagate the signal to children, i.e., the runtime. |
Andreas Gampe | 0df2aba | 2019-06-10 16:53:55 -0700 | [diff] [blame] | 1140 | cmdline="timeout --foreground -k 120s ${TIME_OUT_VALUE}s ${TIMEOUT_DUMPER} -s 15 $cmdline" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1141 | fi |
| 1142 | |
| 1143 | if [ "$DEV_MODE" = "y" ]; then |
Andreas Gampe | 1a6f9fc | 2019-07-02 14:59:00 -0700 | [diff] [blame^] | 1144 | for var in ANDROID_PRINTF_LOG ANDROID_DATA ANDROID_ROOT ANDROID_TZDATA_ROOT ANDROID_RUNTIME_ROOT LD_LIBRARY_PATH DYLD_LIBRARY_PATH PATH LD_USE_LOAD_BIAS; do |
Orion Hodson | ee06c5a | 2018-04-23 13:46:24 +0100 | [diff] [blame] | 1145 | echo EXPORT $var=${!var} |
| 1146 | done |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 1147 | echo "$(declare -f linkdirs)" |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 1148 | echo "mkdir -p ${mkdir_locations} && $setupapex_cmdline && $installapex_cmdline && $linkroot_cmdline && $linkroot_overlay_cmdline && $profman_cmdline && $dex2oat_cmdline && $dm_cmdline && $vdex_cmdline && $strip_cmdline && $sync_cmdline && $cmdline" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1149 | fi |
| 1150 | |
| 1151 | cd $ANDROID_BUILD_TOP |
| 1152 | |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 1153 | # Make sure we delete any existing compiler artifacts. |
| 1154 | # This enables tests to call the RUN script multiple times in a row |
| 1155 | # without worrying about interference. |
| 1156 | rm -rf ${DEX_LOCATION}/oat |
David Srbecky | 2e4afe8 | 2016-01-27 18:42:06 +0000 | [diff] [blame] | 1157 | rm -rf ${DEX_LOCATION}/dalvik-cache/ |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 1158 | |
Andreas Gampe | b31a8e7 | 2017-05-16 10:30:24 -0700 | [diff] [blame] | 1159 | export ASAN_OPTIONS=$RUN_TEST_ASAN_OPTIONS |
| 1160 | |
Alex Light | afb5d19 | 2016-05-24 15:57:45 -0700 | [diff] [blame] | 1161 | mkdir -p ${mkdir_locations} || exit 1 |
Alex Light | 20802ca | 2018-12-05 15:36:03 -0800 | [diff] [blame] | 1162 | $setupapex_cmdline || { echo "zipapex extraction failed." >&2 ; exit 2; } |
Alex Light | 7b1f8cc | 2019-01-31 11:04:51 -0800 | [diff] [blame] | 1163 | $installapex_cmdline || { echo "zipapex install failed. cmd was: ${installapex_cmdline}." >&2; find ${mkdir_locations} -type f >&2; exit 2; } |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 1164 | $linkroot_cmdline || { echo "create symlink android-root failed." >&2 ; exit 2; } |
| 1165 | $linkroot_overlay_cmdline || { echo "overlay android-root failed." >&2 ; exit 2; } |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 1166 | $profman_cmdline || { echo "Profman failed." >&2 ; exit 2; } |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 1167 | $dex2oat_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 1168 | $dm_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 1169 | $vdex_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 1170 | $strip_cmdline || { echo "Strip failed." >&2 ; exit 3; } |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 1171 | $sync_cmdline || { echo "Sync failed." >&2 ; exit 4; } |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 1172 | |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 1173 | if [ "$DRY_RUN" = "y" ]; then |
| 1174 | exit 0 |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 1175 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1176 | |
| 1177 | if [ "$USE_GDB" = "y" ]; then |
| 1178 | # When running under gdb, we cannot do piping and grepping... |
Alex Light | e4b4a18 | 2019-02-12 14:19:49 -0800 | [diff] [blame] | 1179 | $cmdline "$@" |
| 1180 | elif [ "$USE_GDBSERVER" = "y" ]; then |
| 1181 | echo "Connect to $GDBSERVER_PORT" |
| 1182 | # When running under gdb, we cannot do piping and grepping... |
Dmitriy Ivanov | f57874d | 2014-10-07 13:43:23 -0700 | [diff] [blame] | 1183 | $cmdline "$@" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1184 | else |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1185 | if [ "$TIME_OUT" != "gdb" ]; then |
| 1186 | trap 'kill -INT -$pid' INT |
| 1187 | $cmdline "$@" 2>&1 & pid=$! |
| 1188 | wait $pid |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1189 | exit_value=$? |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1190 | # Add extra detail if time out is enabled. |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1191 | if [ $exit_value = 124 ] && [ "$TIME_OUT" = "timeout" ]; then |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1192 | echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 |
| 1193 | fi |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1194 | exit $exit_value |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1195 | else |
| 1196 | # With a thread dump that uses gdb if a timeout. |
| 1197 | trap 'kill -INT -$pid' INT |
| 1198 | $cmdline "$@" 2>&1 & pid=$! |
| 1199 | # Spawn a watcher process. |
| 1200 | ( sleep $TIME_OUT_VALUE && \ |
| 1201 | echo "##### Thread dump using gdb on test timeout" && \ |
| 1202 | ( gdb -q -p $pid --eval-command="info thread" --eval-command="thread apply all bt" \ |
| 1203 | --eval-command="call exit(124)" --eval-command=quit || \ |
| 1204 | kill $pid )) 2> /dev/null & watcher=$! |
| 1205 | wait $pid |
| 1206 | test_exit_status=$? |
| 1207 | pkill -P $watcher 2> /dev/null # kill the sleep which will in turn end the watcher as well |
| 1208 | if [ $test_exit_status = 0 ]; then |
| 1209 | # The test finished normally. |
| 1210 | exit 0 |
| 1211 | else |
| 1212 | # The test failed or timed out. |
| 1213 | if [ $test_exit_status = 124 ]; then |
| 1214 | # The test timed out. |
| 1215 | echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 |
| 1216 | fi |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1217 | exit $test_exit_status |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1218 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1219 | fi |
| 1220 | fi |
| 1221 | fi |