Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Runner for an individual run-test. |
| 4 | |
| 5 | msg() { |
| 6 | if [ "$QUIET" = "n" ]; then |
| 7 | echo "$@" |
| 8 | fi |
| 9 | } |
| 10 | |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 11 | ANDROID_ROOT="/system" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 12 | ARCHITECTURES_32="(arm|x86|mips|none)" |
Andreas Gampe | 1a5c406 | 2015-01-15 12:10:47 -0800 | [diff] [blame] | 13 | ARCHITECTURES_64="(arm64|x86_64|mips64|none)" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 14 | ARCHITECTURES_PATTERN="${ARCHITECTURES_32}" |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 15 | BOOT_IMAGE="" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 16 | COMPILE_FLAGS="" |
| 17 | DALVIKVM="dalvikvm32" |
| 18 | DEBUGGER="n" |
Alex Light | 0e151e7 | 2017-10-25 10:50:35 -0700 | [diff] [blame] | 19 | WITH_AGENT="" |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 20 | DEBUGGER_AGENT="" |
| 21 | WRAP_DEBUGGER_AGENT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 22 | DEV_MODE="n" |
| 23 | DEX2OAT="" |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 24 | EXPERIMENTAL="" |
Nicolas Geoffray | 90355fe | 2017-02-20 09:25:40 +0000 | [diff] [blame] | 25 | FALSE_BIN="false" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 26 | FLAGS="" |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 27 | ANDROID_FLAGS="" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 28 | GDB="" |
Nicolas Geoffray | baf9102 | 2014-10-08 09:56:45 +0100 | [diff] [blame] | 29 | GDB_ARGS="" |
| 30 | GDB_SERVER="gdbserver" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 31 | HAVE_IMAGE="y" |
| 32 | HOST="n" |
| 33 | INTERPRETER="n" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 34 | JIT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 35 | INVOKE_WITH="" |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 36 | IS_JVMTI_TEST="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 37 | ISA=x86 |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 38 | LIBRARY_DIRECTORY="lib" |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 39 | TEST_DIRECTORY="nativetest" |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 40 | MAIN="" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 41 | OPTIMIZE="y" |
| 42 | PATCHOAT="" |
| 43 | PREBUILD="y" |
| 44 | QUIET="n" |
Nicolas Geoffray | 94e25db | 2017-01-27 14:54:28 +0000 | [diff] [blame] | 45 | RELOCATE="n" |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 46 | STRIP_DEX="n" |
Jeff Hao | 207a37d | 2014-10-29 17:24:25 -0700 | [diff] [blame] | 47 | SECONDARY_DEX="" |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 48 | TIME_OUT="gdb" # "n" (disabled), "timeout" (use timeout), "gdb" (use gdb) |
| 49 | # Value in seconds |
Hiroshi Yamauchi | fd3161a | 2017-01-18 14:47:25 -0800 | [diff] [blame] | 50 | if [ "$ART_USE_READ_BARRIER" != "false" ]; then |
Hiroshi Yamauchi | a9b296c | 2016-10-07 17:07:03 -0700 | [diff] [blame] | 51 | TIME_OUT_VALUE=2400 # 40 minutes. |
Hiroshi Yamauchi | dcf0d4b | 2015-09-09 18:59:42 -0700 | [diff] [blame] | 52 | else |
Mathieu Chartier | 2576be2 | 2016-05-24 10:24:53 -0700 | [diff] [blame] | 53 | TIME_OUT_VALUE=1200 # 20 minutes. |
Hiroshi Yamauchi | dcf0d4b | 2015-09-09 18:59:42 -0700 | [diff] [blame] | 54 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 55 | USE_GDB="n" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 56 | USE_JVM="n" |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 57 | USE_JVMTI="n" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 58 | VERIFY="y" # y=yes,n=no,s=softfail |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 59 | ZYGOTE="" |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 60 | DEX_VERIFY="" |
Andreas Gampe | 6535703 | 2015-02-19 15:10:24 -0800 | [diff] [blame] | 61 | USE_DEX2OAT_AND_PATCHOAT="y" |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 62 | INSTRUCTION_SET_FEATURES="" |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 63 | ARGS="" |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 64 | EXTERNAL_LOG_TAGS="n" # if y respect externally set ANDROID_LOG_TAGS. |
| 65 | 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] | 66 | TEST_VDEX="n" |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 67 | TEST_DM="n" |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 68 | TEST_IS_NDEBUG="n" |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 69 | APP_IMAGE="y" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 70 | JVMTI_STRESS="n" |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 71 | JVMTI_STEP_STRESS="n" |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 72 | JVMTI_FIELD_STRESS="n" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 73 | JVMTI_TRACE_STRESS="n" |
| 74 | JVMTI_REDEFINE_STRESS="n" |
Nicolas Geoffray | 7498105 | 2017-01-16 17:54:09 +0000 | [diff] [blame] | 75 | VDEX_FILTER="" |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 76 | PROFILE="n" |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 77 | RANDOM_PROFILE="n" |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 78 | # The normal dex2oat timeout. |
Shubham Ajmera | f97cbd6 | 2017-10-11 10:00:57 -0700 | [diff] [blame] | 79 | DEX2OAT_TIMEOUT="300" # 5 mins |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 80 | # The *hard* timeout where we really start trying to kill the dex2oat. |
Shubham Ajmera | f97cbd6 | 2017-10-11 10:00:57 -0700 | [diff] [blame] | 81 | DEX2OAT_RT_TIMEOUT="360" # 6 mins |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 82 | |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 83 | # if "y", run 'sync' before dalvikvm to make sure all files from |
| 84 | # build step (e.g. dex2oat) were finished writing. |
| 85 | SYNC_BEFORE_RUN="n" |
| 86 | |
Andreas Gampe | 1c5b42f | 2017-06-15 18:20:45 -0700 | [diff] [blame] | 87 | # When running a debug build, we want to run with all checks. |
| 88 | ANDROID_FLAGS="${ANDROID_FLAGS} -XX:SlowDebug=true" |
Andreas Gampe | e8f74ca | 2018-01-02 09:26:16 -0800 | [diff] [blame] | 89 | # The same for dex2oatd, both prebuild and runtime-driven. |
| 90 | ANDROID_FLAGS="${ANDROID_FLAGS} -Xcompiler-option --runtime-arg -Xcompiler-option -XX:SlowDebug=true" |
| 91 | COMPILER_FLAGS="${COMPILER_FLAGS} --runtime-arg -XX:SlowDebug=true" |
Andreas Gampe | 1c5b42f | 2017-06-15 18:20:45 -0700 | [diff] [blame] | 92 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 93 | while true; do |
| 94 | if [ "x$1" = "x--quiet" ]; then |
| 95 | QUIET="y" |
| 96 | shift |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 97 | elif [ "x$1" = "x--dex2oat-rt-timeout" ]; then |
| 98 | shift |
| 99 | if [ "x$1" = "x" ]; then |
| 100 | echo "$0 missing argument to --dex2oat-rt-timeout" 1>&2 |
| 101 | exit 1 |
| 102 | fi |
| 103 | DEX2OAT_RT_TIMEOUT="$1" |
| 104 | shift |
| 105 | elif [ "x$1" = "x--dex2oat-timeout" ]; then |
| 106 | shift |
| 107 | if [ "x$1" = "x" ]; then |
| 108 | echo "$0 missing argument to --dex2oat-timeout" 1>&2 |
| 109 | exit 1 |
| 110 | fi |
| 111 | DEX2OAT_TIMEOUT="$1" |
| 112 | shift |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 113 | elif [ "x$1" = "x--jvmti" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 114 | USE_JVMTI="y" |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 115 | IS_JVMTI_TEST="y" |
| 116 | shift |
Alex Light | faf90b6 | 2016-08-12 14:43:48 -0700 | [diff] [blame] | 117 | elif [ "x$1" = "x-O" ]; then |
Alex Light | e06b634 | 2017-01-05 14:37:21 -0800 | [diff] [blame] | 118 | TEST_IS_NDEBUG="y" |
Alex Light | faf90b6 | 2016-08-12 14:43:48 -0700 | [diff] [blame] | 119 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 120 | elif [ "x$1" = "x--lib" ]; then |
| 121 | shift |
| 122 | if [ "x$1" = "x" ]; then |
| 123 | echo "$0 missing argument to --lib" 1>&2 |
| 124 | exit 1 |
| 125 | fi |
| 126 | LIB="$1" |
| 127 | shift |
Alex Light | 97acf19 | 2016-03-17 09:59:38 -0700 | [diff] [blame] | 128 | elif [ "x$1" = "x--gc-stress" ]; then |
| 129 | # Give an extra 5 mins if we are gc-stress. |
| 130 | TIME_OUT_VALUE=$((${TIME_OUT_VALUE} + 300)) |
| 131 | shift |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 132 | elif [ "x$1" = "x--testlib" ]; then |
| 133 | shift |
| 134 | if [ "x$1" = "x" ]; then |
| 135 | echo "$0 missing argument to --testlib" 1>&2 |
| 136 | exit 1 |
| 137 | fi |
Mathieu Chartier | de286fd | 2015-09-03 18:10:29 -0700 | [diff] [blame] | 138 | ARGS="${ARGS} $1" |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 139 | shift |
David Srbecky | 5288611 | 2016-01-22 13:56:47 +0000 | [diff] [blame] | 140 | elif [ "x$1" = "x--args" ]; then |
| 141 | shift |
| 142 | if [ "x$1" = "x" ]; then |
| 143 | echo "$0 missing argument to --args" 1>&2 |
| 144 | exit 1 |
| 145 | fi |
| 146 | ARGS="${ARGS} $1" |
| 147 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 148 | elif [ "x$1" = "x-Xcompiler-option" ]; then |
| 149 | shift |
| 150 | option="$1" |
| 151 | FLAGS="${FLAGS} -Xcompiler-option $option" |
| 152 | COMPILE_FLAGS="${COMPILE_FLAGS} $option" |
| 153 | shift |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 154 | elif [ "x$1" = "x--android-runtime-option" ]; then |
| 155 | shift |
| 156 | option="$1" |
| 157 | ANDROID_FLAGS="${ANDROID_FLAGS} $option" |
| 158 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 159 | elif [ "x$1" = "x--runtime-option" ]; then |
| 160 | shift |
| 161 | option="$1" |
| 162 | FLAGS="${FLAGS} $option" |
| 163 | shift |
| 164 | elif [ "x$1" = "x--boot" ]; then |
| 165 | shift |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 166 | BOOT_IMAGE="$1" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 167 | shift |
| 168 | elif [ "x$1" = "x--no-dex2oat" ]; then |
| 169 | DEX2OAT="-Xcompiler:${FALSE_BIN}" |
Andreas Gampe | 6535703 | 2015-02-19 15:10:24 -0800 | [diff] [blame] | 170 | USE_DEX2OAT_AND_PATCHOAT="n" |
Andreas Gampe | 5b8a197 | 2017-11-07 10:23:48 -0800 | [diff] [blame] | 171 | PREBUILD="n" # Do not use prebuilt odex, either. |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 172 | shift |
| 173 | elif [ "x$1" = "x--no-patchoat" ]; then |
| 174 | PATCHOAT="-Xpatchoat:${FALSE_BIN}" |
Andreas Gampe | 6535703 | 2015-02-19 15:10:24 -0800 | [diff] [blame] | 175 | USE_DEX2OAT_AND_PATCHOAT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 176 | shift |
| 177 | elif [ "x$1" = "x--relocate" ]; then |
| 178 | RELOCATE="y" |
| 179 | shift |
| 180 | elif [ "x$1" = "x--no-relocate" ]; then |
| 181 | RELOCATE="n" |
| 182 | shift |
| 183 | elif [ "x$1" = "x--prebuild" ]; then |
| 184 | PREBUILD="y" |
| 185 | shift |
Mathieu Chartier | dcd56c9 | 2017-11-20 20:30:24 -0800 | [diff] [blame] | 186 | elif [ "x$1" = "x--compact-dex-level" ]; then |
| 187 | shift |
| 188 | COMPILE_FLAGS="${COMPILE_FLAGS} --compact-dex-level=$1" |
| 189 | shift |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 190 | elif [ "x$1" = "x--jvmti-redefine-stress" ]; then |
| 191 | # APP_IMAGE doesn't really work with jvmti redefine stress |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 192 | USE_JVMTI="y" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 193 | APP_IMAGE="n" |
| 194 | JVMTI_STRESS="y" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 195 | JVMTI_REDEFINE_STRESS="y" |
| 196 | shift |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 197 | elif [ "x$1" = "x--jvmti-step-stress" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 198 | USE_JVMTI="y" |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 199 | JVMTI_STRESS="y" |
| 200 | JVMTI_STEP_STRESS="y" |
| 201 | shift |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 202 | elif [ "x$1" = "x--jvmti-field-stress" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 203 | USE_JVMTI="y" |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 204 | JVMTI_STRESS="y" |
| 205 | JVMTI_FIELD_STRESS="y" |
| 206 | shift |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 207 | elif [ "x$1" = "x--jvmti-trace-stress" ]; then |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 208 | USE_JVMTI="y" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 209 | JVMTI_STRESS="y" |
| 210 | JVMTI_TRACE_STRESS="y" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 211 | shift |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 212 | elif [ "x$1" = "x--no-app-image" ]; then |
| 213 | APP_IMAGE="n" |
| 214 | shift |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 215 | elif [ "x$1" = "x--strip-dex" ]; then |
| 216 | STRIP_DEX="y" |
| 217 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 218 | elif [ "x$1" = "x--host" ]; then |
| 219 | HOST="y" |
Nicolas Geoffray | 8eedb47 | 2014-10-29 14:05:59 +0000 | [diff] [blame] | 220 | ANDROID_ROOT="$ANDROID_HOST_OUT" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 221 | shift |
| 222 | elif [ "x$1" = "x--no-prebuild" ]; then |
| 223 | PREBUILD="n" |
| 224 | shift |
| 225 | elif [ "x$1" = "x--no-image" ]; then |
| 226 | HAVE_IMAGE="n" |
| 227 | shift |
Jeff Hao | 207a37d | 2014-10-29 17:24:25 -0700 | [diff] [blame] | 228 | elif [ "x$1" = "x--secondary" ]; then |
| 229 | SECONDARY_DEX=":$DEX_LOCATION/$TEST_NAME-ex.jar" |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 230 | # Enable cfg-append to make sure we get the dump for both dex files. |
| 231 | # (otherwise the runtime compilation of the secondary dex will overwrite |
Roland Levillain | b0103ca | 2016-11-01 14:48:47 +0000 | [diff] [blame] | 232 | # the dump of the first one). |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 233 | FLAGS="${FLAGS} -Xcompiler-option --dump-cfg-append" |
| 234 | COMPILE_FLAGS="${COMPILE_FLAGS} --dump-cfg-append" |
Jeff Hao | 207a37d | 2014-10-29 17:24:25 -0700 | [diff] [blame] | 235 | shift |
Alex Light | 0e151e7 | 2017-10-25 10:50:35 -0700 | [diff] [blame] | 236 | elif [ "x$1" = "x--with-agent" ]; then |
| 237 | shift |
| 238 | USE_JVMTI="y" |
| 239 | WITH_AGENT="$1" |
| 240 | shift |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 241 | elif [ "x$1" = "x--debug-wrap-agent" ]; then |
| 242 | WRAP_DEBUGGER_AGENT="y" |
| 243 | shift |
| 244 | elif [ "x$1" = "x--debug-agent" ]; then |
| 245 | shift |
| 246 | DEBUGGER="agent" |
| 247 | USE_JVMTI="y" |
| 248 | DEBUGGER_AGENT="$1" |
| 249 | TIME_OUT="n" |
| 250 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 251 | elif [ "x$1" = "x--debug" ]; then |
| 252 | DEBUGGER="y" |
Brian Carlstrom | 93d6ce5 | 2014-11-04 22:31:35 -0800 | [diff] [blame] | 253 | TIME_OUT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 254 | shift |
| 255 | elif [ "x$1" = "x--gdb" ]; then |
| 256 | USE_GDB="y" |
| 257 | DEV_MODE="y" |
Brian Carlstrom | 93d6ce5 | 2014-11-04 22:31:35 -0800 | [diff] [blame] | 258 | TIME_OUT="n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 259 | shift |
Mathieu Chartier | c0a8a80 | 2014-10-17 15:58:01 -0700 | [diff] [blame] | 260 | elif [ "x$1" = "x--gdb-arg" ]; then |
| 261 | shift |
| 262 | gdb_arg="$1" |
| 263 | GDB_ARGS="${GDB_ARGS} $gdb_arg" |
| 264 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 265 | elif [ "x$1" = "x--zygote" ]; then |
| 266 | ZYGOTE="-Xzygote" |
| 267 | msg "Spawning from zygote" |
| 268 | shift |
| 269 | elif [ "x$1" = "x--dev" ]; then |
| 270 | DEV_MODE="y" |
| 271 | shift |
| 272 | elif [ "x$1" = "x--interpreter" ]; then |
| 273 | INTERPRETER="y" |
| 274 | shift |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 275 | elif [ "x$1" = "x--jit" ]; then |
| 276 | JIT="y" |
| 277 | shift |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 278 | elif [ "x$1" = "x--jvm" ]; then |
| 279 | USE_JVM="y" |
| 280 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 281 | elif [ "x$1" = "x--invoke-with" ]; then |
| 282 | shift |
| 283 | if [ "x$1" = "x" ]; then |
| 284 | echo "$0 missing argument to --invoke-with" 1>&2 |
| 285 | exit 1 |
| 286 | fi |
| 287 | if [ "x$INVOKE_WITH" = "x" ]; then |
| 288 | INVOKE_WITH="$1" |
| 289 | else |
| 290 | INVOKE_WITH="$INVOKE_WITH $1" |
| 291 | fi |
| 292 | shift |
| 293 | elif [ "x$1" = "x--no-verify" ]; then |
| 294 | VERIFY="n" |
| 295 | shift |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 296 | elif [ "x$1" = "x--verify-soft-fail" ]; then |
| 297 | VERIFY="s" |
| 298 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 299 | elif [ "x$1" = "x--no-optimize" ]; then |
| 300 | OPTIMIZE="n" |
| 301 | shift |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 302 | elif [ "x$1" = "x--android-root" ]; then |
| 303 | shift |
| 304 | ANDROID_ROOT="$1" |
| 305 | shift |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 306 | elif [ "x$1" = "x--instruction-set-features" ]; then |
| 307 | shift |
| 308 | INSTRUCTION_SET_FEATURES="$1" |
| 309 | shift |
Mathieu Chartier | 2576be2 | 2016-05-24 10:24:53 -0700 | [diff] [blame] | 310 | elif [ "x$1" = "x--timeout" ]; then |
| 311 | shift |
| 312 | TIME_OUT_VALUE="$1" |
| 313 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 314 | elif [ "x$1" = "x--" ]; then |
| 315 | shift |
| 316 | break |
| 317 | elif [ "x$1" = "x--64" ]; then |
| 318 | ISA="x86_64" |
| 319 | GDB_SERVER="gdbserver64" |
| 320 | DALVIKVM="dalvikvm64" |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 321 | LIBRARY_DIRECTORY="lib64" |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 322 | TEST_DIRECTORY="nativetest64" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 323 | ARCHITECTURES_PATTERN="${ARCHITECTURES_64}" |
| 324 | shift |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 325 | elif [ "x$1" = "x--pic-test" ]; then |
| 326 | FLAGS="${FLAGS} -Xcompiler-option --compile-pic" |
| 327 | COMPILE_FLAGS="${COMPILE_FLAGS} --compile-pic" |
| 328 | shift |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 329 | elif [ "x$1" = "x--experimental" ]; then |
| 330 | if [ "$#" -lt 2 ]; then |
| 331 | echo "missing --experimental option" 1>&2 |
| 332 | exit 1 |
| 333 | fi |
| 334 | EXPERIMENTAL="$EXPERIMENTAL $2" |
| 335 | shift 2 |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 336 | elif [ "x$1" = "x--external-log-tags" ]; then |
| 337 | EXTERNAL_LOG_TAGS="y" |
| 338 | shift |
| 339 | elif [ "x$1" = "x--dry-run" ]; then |
| 340 | DRY_RUN="y" |
| 341 | shift |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 342 | elif [ "x$1" = "x--vdex" ]; then |
| 343 | TEST_VDEX="y" |
| 344 | shift |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 345 | elif [ "x$1" = "x--dm" ]; then |
| 346 | TEST_DM="y" |
| 347 | shift |
Nicolas Geoffray | 7498105 | 2017-01-16 17:54:09 +0000 | [diff] [blame] | 348 | elif [ "x$1" = "x--vdex-filter" ]; then |
| 349 | shift |
| 350 | option="$1" |
| 351 | VDEX_FILTER="--compiler-filter=$option" |
| 352 | shift |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 353 | elif [ "x$1" = "x--sync" ]; then |
| 354 | SYNC_BEFORE_RUN="y" |
| 355 | shift |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 356 | elif [ "x$1" = "x--profile" ]; then |
| 357 | PROFILE="y" |
| 358 | shift |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 359 | elif [ "x$1" = "x--random-profile" ]; then |
| 360 | RANDOM_PROFILE="y" |
| 361 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 362 | elif expr "x$1" : "x--" >/dev/null 2>&1; then |
| 363 | echo "unknown $0 option: $1" 1>&2 |
| 364 | exit 1 |
| 365 | else |
| 366 | break |
| 367 | fi |
| 368 | done |
| 369 | |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 370 | if [ "$USE_JVM" = "n" ]; then |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 371 | FLAGS="${FLAGS} ${ANDROID_FLAGS}" |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 372 | for feature in ${EXPERIMENTAL}; do |
Alex Light | fa02285 | 2015-10-28 09:13:20 -0700 | [diff] [blame] | 373 | FLAGS="${FLAGS} -Xexperimental:${feature} -Xcompiler-option --runtime-arg -Xcompiler-option -Xexperimental:${feature}" |
Alex Light | 8a0e033 | 2015-10-26 10:11:58 -0700 | [diff] [blame] | 374 | COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xexperimental:${feature}" |
| 375 | done |
| 376 | fi |
| 377 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 378 | if [ "x$1" = "x" ] ; then |
| 379 | MAIN="Main" |
| 380 | else |
| 381 | MAIN="$1" |
Andreas Gampe | f2fdc73 | 2014-06-11 08:20:47 -0700 | [diff] [blame] | 382 | shift |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 383 | fi |
| 384 | |
| 385 | if [ "$ZYGOTE" = "" ]; then |
| 386 | if [ "$OPTIMIZE" = "y" ]; then |
| 387 | if [ "$VERIFY" = "y" ]; then |
| 388 | DEX_OPTIMIZE="-Xdexopt:verified" |
| 389 | else |
| 390 | DEX_OPTIMIZE="-Xdexopt:all" |
| 391 | fi |
| 392 | msg "Performing optimizations" |
| 393 | else |
| 394 | DEX_OPTIMIZE="-Xdexopt:none" |
| 395 | msg "Skipping optimizations" |
| 396 | fi |
| 397 | |
| 398 | if [ "$VERIFY" = "y" ]; then |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 399 | JVM_VERIFY_ARG="-Xverify:all" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 400 | msg "Performing verification" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 401 | elif [ "$VERIFY" = "s" ]; then |
| 402 | JVM_VERIFY_ARG="Xverify:all" |
| 403 | DEX_VERIFY="-Xverify:softfail" |
| 404 | msg "Forcing verification to be soft fail" |
| 405 | else # VERIFY = "n" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 406 | DEX_VERIFY="-Xverify:none" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 407 | JVM_VERIFY_ARG="-Xverify:none" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 408 | msg "Skipping verification" |
| 409 | fi |
| 410 | fi |
| 411 | |
| 412 | msg "------------------------------" |
| 413 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 414 | if [ "$DEBUGGER" = "y" ]; then |
| 415 | # Use this instead for ddms and connect by running 'ddms': |
| 416 | # DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_android_adb,server=y,suspend=y" |
| 417 | # TODO: add a separate --ddms option? |
| 418 | |
| 419 | PORT=12345 |
| 420 | msg "Waiting for jdb to connect:" |
| 421 | if [ "$HOST" = "n" ]; then |
| 422 | msg " adb forward tcp:$PORT tcp:$PORT" |
| 423 | fi |
| 424 | msg " jdb -attach localhost:$PORT" |
Alex Light | 264a486 | 2018-01-31 16:47:58 +0000 | [diff] [blame] | 425 | if [ "$USE_JVM" = "n" ]; then |
| 426 | # TODO We should switch over to using the jvmti agent by default. |
| 427 | # Need to tell the runtime to enable the internal jdwp implementation. |
| 428 | DEBUGGER_OPTS="-XjdwpOptions:transport=dt_socket,address=$PORT,server=y,suspend=y -XjdwpProvider:internal" |
| 429 | else |
| 430 | DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y" |
| 431 | fi |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 432 | elif [ "$DEBUGGER" = "agent" ]; then |
| 433 | PORT=12345 |
| 434 | # TODO Support ddms connection and support target. |
| 435 | if [ "$HOST" = "n" ]; then |
| 436 | echo "--debug-agent not supported yet for target!" |
| 437 | exit 1 |
| 438 | fi |
| 439 | AGENTPATH=${DEBUGGER_AGENT} |
| 440 | if [ "$WRAP_DEBUGGER_AGENT" = "y" ]; then |
| 441 | WRAPPROPS="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}/libwrapagentpropertiesd.so" |
| 442 | if [ "$TEST_IS_NDEBUG" = "y" ]; then |
| 443 | WRAPPROPS="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}/libwrapagentproperties.so" |
| 444 | fi |
| 445 | AGENTPATH="${WRAPPROPS}=${ANDROID_BUILD_TOP}/art/tools/libjdwp-compat.props,${AGENTPATH}" |
| 446 | fi |
| 447 | msg "Connect to localhost:$PORT" |
| 448 | DEBUGGER_OPTS="-agentpath:${AGENTPATH}=transport=dt_socket,address=$PORT,server=y,suspend=y" |
| 449 | fi |
| 450 | |
Alex Light | 0e151e7 | 2017-10-25 10:50:35 -0700 | [diff] [blame] | 451 | if [ "x$WITH_AGENT" != "x" ]; then |
| 452 | FLAGS="${FLAGS} -agentpath:${WITH_AGENT}" |
| 453 | fi |
| 454 | |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 455 | if [ "$USE_JVMTI" = "y" ]; then |
| 456 | if [ "$USE_JVM" = "n" ]; then |
| 457 | plugin=libopenjdkjvmtid.so |
| 458 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 459 | plugin=libopenjdkjvmti.so |
| 460 | fi |
Alex Light | 2ce6fc8 | 2017-12-18 16:42:36 -0800 | [diff] [blame] | 461 | # We used to add flags here that made the runtime debuggable but that is not |
| 462 | # needed anymore since the plugin can do it for us now. |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 463 | FLAGS="${FLAGS} -Xplugin:${plugin}" |
Alex Light | c281ba5 | 2017-10-11 11:35:55 -0700 | [diff] [blame] | 464 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 465 | fi |
| 466 | |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 467 | if [ "$IS_JVMTI_TEST" = "y" ]; then |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 468 | agent=libtiagentd.so |
| 469 | lib=tiagentd |
| 470 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 471 | agent=libtiagent.so |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 472 | lib=tiagent |
| 473 | fi |
| 474 | |
| 475 | ARGS="${ARGS} ${lib}" |
| 476 | if [[ "$USE_JVM" = "y" ]]; then |
| 477 | FLAGS="${FLAGS} -agentpath:${ANDROID_HOST_OUT}/nativetest64/${agent}=${TEST_NAME},jvm" |
| 478 | else |
| 479 | FLAGS="${FLAGS} -agentpath:${agent}=${TEST_NAME},art" |
Alex Light | fba89fe | 2017-01-12 16:11:02 -0800 | [diff] [blame] | 480 | fi |
| 481 | fi |
| 482 | |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 483 | if [[ "$JVMTI_STRESS" = "y" ]]; then |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 484 | agent=libtistressd.so |
| 485 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 486 | agent=libtistress.so |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 487 | fi |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 488 | |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 489 | # Just give it a default start so we can always add ',' to it. |
| 490 | agent_args="jvmti-stress" |
| 491 | if [[ "$JVMTI_REDEFINE_STRESS" = "y" ]]; then |
| 492 | # We really cannot do this on RI so don't both passing it in that case. |
| 493 | if [[ "$USE_JVM" = "n" ]]; then |
Alex Light | ceae954 | 2017-09-07 13:28:00 -0700 | [diff] [blame] | 494 | agent_args="${agent_args},redefine" |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 495 | fi |
| 496 | fi |
Alex Light | 43e935d | 2017-06-19 15:40:40 -0700 | [diff] [blame] | 497 | if [[ "$JVMTI_FIELD_STRESS" = "y" ]]; then |
| 498 | agent_args="${agent_args},field" |
| 499 | fi |
Alex Light | c38c369 | 2017-06-27 15:45:14 -0700 | [diff] [blame] | 500 | if [[ "$JVMTI_STEP_STRESS" = "y" ]]; then |
| 501 | agent_args="${agent_args},step" |
| 502 | fi |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 503 | if [[ "$JVMTI_TRACE_STRESS" = "y" ]]; then |
| 504 | agent_args="${agent_args},trace" |
| 505 | fi |
| 506 | # In the future add onto this; |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 507 | if [[ "$USE_JVM" = "y" ]]; then |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 508 | FLAGS="${FLAGS} -agentpath:${ANDROID_HOST_OUT}/nativetest64/${agent}=${agent_args}" |
Alex Light | 42151c0 | 2017-04-20 15:54:25 -0700 | [diff] [blame] | 509 | else |
Alex Light | b7edcda | 2017-04-27 13:20:31 -0700 | [diff] [blame] | 510 | FLAGS="${FLAGS} -agentpath:${agent}=${agent_args}" |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 511 | fi |
| 512 | fi |
| 513 | |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 514 | if [ "$USE_JVM" = "y" ]; then |
Alex Light | 9c20a14 | 2016-08-23 15:05:12 -0700 | [diff] [blame] | 515 | export LD_LIBRARY_PATH=${ANDROID_HOST_OUT}/lib64 |
Alex Light | 47d49b8 | 2017-07-25 14:06:34 -0700 | [diff] [blame] | 516 | # Some jvmti tests are flaky without -Xint on the RI. |
| 517 | if [ "$IS_JVMTI_TEST" = "y" ]; then |
| 518 | FLAGS="${FLAGS} -Xint" |
| 519 | fi |
Mathieu Chartier | a61894d | 2015-04-23 16:32:54 -0700 | [diff] [blame] | 520 | # 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] | 521 | # We pass the classes2 path whether it's used (src-multidex) or not. |
| 522 | 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] | 523 | if [ "$DEV_MODE" = "y" ]; then |
| 524 | echo $cmdline |
| 525 | fi |
| 526 | $cmdline |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 527 | exit |
| 528 | fi |
| 529 | |
| 530 | |
| 531 | if [ "$HAVE_IMAGE" = "n" ]; then |
Vladimir Marko | e00e559 | 2017-02-24 14:58:29 +0000 | [diff] [blame] | 532 | if [ "${HOST}" = "y" ]; then |
| 533 | framework="${ANDROID_HOST_OUT}/framework" |
| 534 | bpath_suffix="-hostdex" |
| 535 | else |
| 536 | framework="${ANDROID_ROOT}/framework" |
Nicolas Geoffray | 320ccca | 2017-03-01 10:03:08 +0000 | [diff] [blame] | 537 | bpath_suffix="-testdex" |
Vladimir Marko | e00e559 | 2017-02-24 14:58:29 +0000 | [diff] [blame] | 538 | fi |
Vladimir Marko | e00e559 | 2017-02-24 14:58:29 +0000 | [diff] [blame] | 539 | bpath="${framework}/core-libart${bpath_suffix}.jar" |
| 540 | bpath="${bpath}:${framework}/core-oj${bpath_suffix}.jar" |
| 541 | bpath="${bpath}:${framework}/conscrypt${bpath_suffix}.jar" |
| 542 | bpath="${bpath}:${framework}/okhttp${bpath_suffix}.jar" |
| 543 | bpath="${bpath}:${framework}/bouncycastle${bpath_suffix}.jar" |
| 544 | # Pass down the bootclasspath |
| 545 | FLAGS="${FLAGS} -Xbootclasspath:${bpath}" |
Andreas Gampe | 1078d15 | 2017-11-07 18:00:54 -0800 | [diff] [blame] | 546 | # Disable image dex2oat - this will forbid the runtime to patch or compile an image. |
| 547 | FLAGS="${FLAGS} -Xnoimage-dex2oat" |
| 548 | |
| 549 | # We'll abuse a second flag here to test different behavior. If --relocate, use the |
| 550 | # existing image - relocation will fail as patching is disallowed. If --no-relocate, |
| 551 | # pass a non-existent image - compilation will fail as dex2oat is disallowed. |
| 552 | if [ "${RELOCATE}" = "y" ] ; then |
| 553 | DALVIKVM_BOOT_OPT="-Ximage:${BOOT_IMAGE}" |
| 554 | else |
Roland Levillain | ef01222 | 2017-06-21 16:28:06 +0100 | [diff] [blame] | 555 | DALVIKVM_BOOT_OPT="-Ximage:/system/non-existent/core.art" |
Andreas Gampe | 1078d15 | 2017-11-07 18:00:54 -0800 | [diff] [blame] | 556 | fi |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 557 | else |
| 558 | DALVIKVM_BOOT_OPT="-Ximage:${BOOT_IMAGE}" |
Nicolas Geoffray | 288a4a2 | 2014-10-07 11:02:40 +0100 | [diff] [blame] | 559 | fi |
| 560 | |
| 561 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 562 | if [ "$USE_GDB" = "y" ]; then |
| 563 | if [ "$HOST" = "n" ]; then |
| 564 | GDB="$GDB_SERVER :5039" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 565 | else |
| 566 | if [ `uname` = "Darwin" ]; then |
| 567 | GDB=lldb |
Mathieu Chartier | c0a8a80 | 2014-10-17 15:58:01 -0700 | [diff] [blame] | 568 | GDB_ARGS="$GDB_ARGS -- $DALVIKVM" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 569 | DALVIKVM= |
| 570 | else |
| 571 | GDB=gdb |
Mathieu Chartier | c0a8a80 | 2014-10-17 15:58:01 -0700 | [diff] [blame] | 572 | GDB_ARGS="$GDB_ARGS --args $DALVIKVM" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 573 | # Enable for Emacs "M-x gdb" support. TODO: allow extra gdb arguments on command line. |
| 574 | # gdbargs="--annotate=3 $gdbargs" |
| 575 | fi |
| 576 | fi |
| 577 | fi |
| 578 | |
| 579 | if [ "$INTERPRETER" = "y" ]; then |
Nicolas Geoffray | e722d29 | 2015-12-15 11:51:37 +0000 | [diff] [blame] | 580 | INT_OPTS="-Xint" |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 581 | if [ "$VERIFY" = "y" ] ; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 582 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=quicken" |
| 583 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=quicken" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 584 | elif [ "$VERIFY" = "s" ]; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 585 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=extract" |
| 586 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=extract" |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 587 | DEX_VERIFY="${DEX_VERIFY} -Xverify:softfail" |
| 588 | else # VERIFY = "n" |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 589 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=assume-verified" |
| 590 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=assume-verified" |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 591 | DEX_VERIFY="${DEX_VERIFY} -Xverify:none" |
| 592 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 593 | fi |
| 594 | |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 595 | if [ "$JIT" = "y" ]; then |
Nicolas Geoffray | e722d29 | 2015-12-15 11:51:37 +0000 | [diff] [blame] | 596 | INT_OPTS="-Xusejit:true" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 597 | if [ "$VERIFY" = "y" ] ; then |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 598 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=quicken" |
| 599 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=quicken" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 600 | else |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 601 | INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=assume-verified" |
| 602 | COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=assume-verified" |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 603 | DEX_VERIFY="${DEX_VERIFY} -Xverify:none" |
| 604 | fi |
| 605 | fi |
| 606 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 607 | JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni" |
| 608 | |
Richard Uhler | 020c0f3 | 2017-03-14 16:23:17 +0000 | [diff] [blame] | 609 | COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xnorelocate" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 610 | if [ "$RELOCATE" = "y" ]; then |
Richard Uhler | c52f303 | 2017-03-02 13:45:45 +0000 | [diff] [blame] | 611 | FLAGS="${FLAGS} -Xrelocate" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 612 | else |
| 613 | FLAGS="$FLAGS -Xnorelocate" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 614 | fi |
| 615 | |
| 616 | if [ "$HOST" = "n" ]; then |
Nicolas Geoffray | d295bc8 | 2016-11-04 13:03:05 +0000 | [diff] [blame] | 617 | # Need to be root to query /data/dalvik-cache |
| 618 | adb root > /dev/null |
| 619 | adb wait-for-device |
| 620 | ISA= |
| 621 | ISA_adb_invocation= |
| 622 | ISA_outcome= |
| 623 | # We iterate a few times to workaround an adb issue. b/32655576 |
| 624 | for i in {1..10}; do |
| 625 | ISA_adb_invocation=$(adb shell ls -F /data/dalvik-cache) |
| 626 | ISA_outcome=$? |
| 627 | ISA=$(echo $ISA_adb_invocation | grep -Ewo "${ARCHITECTURES_PATTERN}") |
| 628 | if [ x"$ISA" != "x" ]; then |
| 629 | break; |
| 630 | fi |
| 631 | done |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 632 | if [ x"$ISA" = "x" ]; then |
| 633 | echo "Unable to determine architecture" |
Nicolas Geoffray | 8f500fa | 2016-11-03 11:18:48 +0000 | [diff] [blame] | 634 | # Print a few things for helping diagnosing the problem. |
Nicolas Geoffray | d295bc8 | 2016-11-04 13:03:05 +0000 | [diff] [blame] | 635 | echo "adb invocation output: $ISA_adb_invocation" |
| 636 | echo "adb invocation outcome: $ISA_outcome" |
Nicolas Geoffray | 8f500fa | 2016-11-03 11:18:48 +0000 | [diff] [blame] | 637 | echo $(adb shell ls -F /data/dalvik-cache) |
| 638 | echo $(adb shell ls /data/dalvik-cache) |
| 639 | echo ${ARCHITECTURES_PATTERN} |
| 640 | echo $(adb shell ls -F /data/dalvik-cache | grep -Ewo "${ARCHITECTURES_PATTERN}") |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 641 | exit 1 |
| 642 | fi |
| 643 | fi |
| 644 | |
Wojciech Staszkiewicz | e663653 | 2016-09-23 10:59:55 -0700 | [diff] [blame] | 645 | # Prevent test from silently falling back to interpreter in no-prebuild mode. This happens |
| 646 | # when DEX_LOCATION path is too long, because vdex/odex filename is constructed by taking |
| 647 | # full path to dex, stripping leading '/', appending '@classes.vdex' and changing every |
| 648 | # remaining '/' into '@'. |
| 649 | if [ "$HOST" = "y" ]; then |
| 650 | max_filename_size=$(getconf NAME_MAX $DEX_LOCATION) |
| 651 | else |
Roland Levillain | 2ae376f | 2018-01-30 11:35:11 +0000 | [diff] [blame] | 652 | # There is no getconf on device, fallback to standard value. |
| 653 | # See NAME_MAX in kernel <linux/limits.h> |
Wojciech Staszkiewicz | e663653 | 2016-09-23 10:59:55 -0700 | [diff] [blame] | 654 | max_filename_size=255 |
| 655 | fi |
| 656 | # Compute VDEX_NAME. |
| 657 | DEX_LOCATION_STRIPPED="${DEX_LOCATION#/}" |
| 658 | VDEX_NAME="${DEX_LOCATION_STRIPPED//\//@}@$TEST_NAME.jar@classes.vdex" |
| 659 | if [ ${#VDEX_NAME} -gt $max_filename_size ]; then |
Nicolas Geoffray | bea3e31 | 2017-03-07 09:59:05 +0000 | [diff] [blame] | 660 | echo "Dex location path too long:" |
| 661 | 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] | 662 | exit 1 |
| 663 | fi |
| 664 | |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 665 | profman_cmdline="true" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 666 | dex2oat_cmdline="true" |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 667 | vdex_cmdline="true" |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 668 | dm_cmdline="true" |
Andreas Gampe | b09abb2 | 2018-05-03 11:51:22 -0700 | [diff] [blame^] | 669 | mkdir_locations="${DEX_LOCATION}/dalvik-cache/$ISA" |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 670 | strip_cmdline="true" |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 671 | sync_cmdline="true" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 672 | |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 673 | # PROFILE takes precedence over RANDOM_PROFILE, since PROFILE tests require a |
| 674 | # specific profile to run properly. |
| 675 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
Nicolas Geoffray | 0b6a638 | 2017-03-10 09:38:35 +0000 | [diff] [blame] | 676 | profman_cmdline="${ANDROID_ROOT}/bin/profman \ |
| 677 | --apk=$DEX_LOCATION/$TEST_NAME.jar \ |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 678 | --dex-location=$DEX_LOCATION/$TEST_NAME.jar" |
Calin Juravle | 6df62f7 | 2017-04-28 19:58:01 -0700 | [diff] [blame] | 679 | if [ -f $DEX_LOCATION/$TEST_NAME-ex.jar ]; then |
| 680 | profman_cmdline="${profman_cmdline} \ |
| 681 | --apk=$DEX_LOCATION/$TEST_NAME-ex.jar \ |
| 682 | --dex-location=$DEX_LOCATION/$TEST_NAME-ex.jar" |
| 683 | fi |
Nicolas Geoffray | 0b6a638 | 2017-03-10 09:38:35 +0000 | [diff] [blame] | 684 | COMPILE_FLAGS="${COMPILE_FLAGS} --profile-file=$DEX_LOCATION/$TEST_NAME.prof" |
| 685 | FLAGS="${FLAGS} -Xcompiler-option --profile-file=$DEX_LOCATION/$TEST_NAME.prof" |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 686 | if [ "$PROFILE" = "y" ]; then |
| 687 | profman_cmdline="${profman_cmdline} --create-profile-from=$DEX_LOCATION/profile \ |
| 688 | --reference-profile-file=$DEX_LOCATION/$TEST_NAME.prof" |
| 689 | else |
| 690 | profman_cmdline="${profman_cmdline} --generate-test-profile=$DEX_LOCATION/$TEST_NAME.prof \ |
| 691 | --generate-test-profile-seed=0" |
| 692 | fi |
Nicolas Geoffray | 0b6a638 | 2017-03-10 09:38:35 +0000 | [diff] [blame] | 693 | fi |
| 694 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 695 | if [ "$PREBUILD" = "y" ]; then |
Alex Light | afb5d19 | 2016-05-24 15:57:45 -0700 | [diff] [blame] | 696 | mkdir_locations="${mkdir_locations} ${DEX_LOCATION}/oat/$ISA" |
Calin Juravle | 857f058 | 2016-12-20 14:36:59 +0000 | [diff] [blame] | 697 | if [ "$APP_IMAGE" = "y" ]; then |
| 698 | # Pick a base that will force the app image to get relocated. |
| 699 | app_image="--base=0x4000 --app-image-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.art" |
| 700 | fi |
| 701 | |
Roland Levillain | 6c3af16 | 2017-04-27 11:18:56 +0100 | [diff] [blame] | 702 | dex2oat_binary=dex2oatd |
| 703 | if [[ "$TEST_IS_NDEBUG" = "y" ]]; then |
| 704 | dex2oat_binary=dex2oat |
| 705 | fi |
| 706 | dex2oat_cmdline="$INVOKE_WITH $ANDROID_ROOT/bin/$dex2oat_binary \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 707 | $COMPILE_FLAGS \ |
Nicolas Geoffray | 68e25eb | 2014-10-29 23:02:11 +0000 | [diff] [blame] | 708 | --boot-image=${BOOT_IMAGE} \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 709 | --dex-file=$DEX_LOCATION/$TEST_NAME.jar \ |
Andreas Gampe | 1475924 | 2016-03-23 10:54:21 -0700 | [diff] [blame] | 710 | --oat-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.odex \ |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 711 | ${app_image} \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 712 | --instruction-set=$ISA" |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 713 | if [ "x$INSTRUCTION_SET_FEATURES" != "x" ] ; then |
| 714 | dex2oat_cmdline="${dex2oat_cmdline} --instruction-set-features=${INSTRUCTION_SET_FEATURES}" |
| 715 | fi |
Andreas Gampe | 2ea7b70 | 2015-08-07 08:07:16 -0700 | [diff] [blame] | 716 | |
| 717 | # Add in a timeout. This is important for testing the compilation/verification time of |
| 718 | # pathological cases. |
| 719 | # Note: as we don't know how decent targets are (e.g., emulator), only do this on the host for |
| 720 | # now. We should try to improve this. |
| 721 | # The current value is rather arbitrary. run-tests should compile quickly. |
Alex Light | 483208d | 2017-09-26 09:31:17 -0700 | [diff] [blame] | 722 | # 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] | 723 | if [ "$HOST" != "n" ]; then |
| 724 | # Use SIGRTMIN+2 to try to dump threads. |
| 725 | # 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] | 726 | 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] | 727 | fi |
Nicolas Geoffray | fbc4f11 | 2017-04-27 21:45:35 +0100 | [diff] [blame] | 728 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
| 729 | vdex_cmdline="${dex2oat_cmdline} ${VDEX_FILTER} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex --output-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex" |
| 730 | elif [ "$TEST_VDEX" = "y" ]; then |
Nicolas Geoffray | 7498105 | 2017-01-16 17:54:09 +0000 | [diff] [blame] | 731 | vdex_cmdline="${dex2oat_cmdline} ${VDEX_FILTER} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex" |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 732 | elif [ "$TEST_DM" = "y" ]; then |
| 733 | dex2oat_cmdline="${dex2oat_cmdline} --output-vdex=$DEX_LOCATION/oat/$ISA/primary.vdex" |
| 734 | dm_cmdline="zip -qj $DEX_LOCATION/oat/$ISA/$TEST_NAME.dm $DEX_LOCATION/oat/$ISA/primary.vdex" |
| 735 | vdex_cmdline="${dex2oat_cmdline} --dump-timings --dm-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.dm" |
Nicolas Geoffray | cab6557 | 2017-04-21 17:16:44 +0100 | [diff] [blame] | 736 | elif [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
| 737 | 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] | 738 | fi |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 739 | fi |
| 740 | |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 741 | if [ "$STRIP_DEX" = "y" ]; then |
| 742 | strip_cmdline="zip --quiet --delete $DEX_LOCATION/$TEST_NAME.jar classes.dex" |
| 743 | fi |
| 744 | |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 745 | if [ "$SYNC_BEFORE_RUN" = "y" ]; then |
| 746 | sync_cmdline="sync" |
| 747 | fi |
| 748 | |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 749 | DALVIKVM_ISA_FEATURES_ARGS="" |
| 750 | if [ "x$INSTRUCTION_SET_FEATURES" != "x" ] ; then |
| 751 | DALVIKVM_ISA_FEATURES_ARGS="-Xcompiler-option --instruction-set-features=${INSTRUCTION_SET_FEATURES}" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 752 | fi |
| 753 | |
Nicolas Geoffray | c525604 | 2015-12-26 19:41:37 +0000 | [diff] [blame] | 754 | # java.io.tmpdir can only be set at launch time. |
| 755 | TMP_DIR_OPTION="" |
| 756 | if [ "$HOST" = "n" ]; then |
| 757 | TMP_DIR_OPTION="-Djava.io.tmpdir=/data/local/tmp" |
| 758 | fi |
| 759 | |
Nicolas Geoffray | 6ee4971 | 2018-03-30 14:39:05 +0000 | [diff] [blame] | 760 | # We set DumpNativeStackOnSigQuit to false to avoid stressing libunwind. |
| 761 | # b/27185632 |
| 762 | # b/24664297 |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 763 | dalvikvm_cmdline="$INVOKE_WITH $GDB $ANDROID_ROOT/bin/$DALVIKVM \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 764 | $GDB_ARGS \ |
| 765 | $FLAGS \ |
Andreas Gampe | 2b0fa5b | 2014-10-31 18:12:30 -0700 | [diff] [blame] | 766 | $DEX_VERIFY \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 767 | -XXlib:$LIB \ |
| 768 | $PATCHOAT \ |
| 769 | $DEX2OAT \ |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 770 | $DALVIKVM_ISA_FEATURES_ARGS \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 771 | $ZYGOTE \ |
| 772 | $JNI_OPTS \ |
| 773 | $INT_OPTS \ |
| 774 | $DEBUGGER_OPTS \ |
| 775 | $DALVIKVM_BOOT_OPT \ |
Nicolas Geoffray | c525604 | 2015-12-26 19:41:37 +0000 | [diff] [blame] | 776 | $TMP_DIR_OPTION \ |
Nicolas Geoffray | 6ee4971 | 2018-03-30 14:39:05 +0000 | [diff] [blame] | 777 | -XX:DumpNativeStackOnSigQuit:false \ |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 778 | -cp $DEX_LOCATION/$TEST_NAME.jar$SECONDARY_DEX $MAIN $ARGS" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 779 | |
Andreas Gampe | 3ad5d5e | 2015-02-03 18:26:55 -0800 | [diff] [blame] | 780 | # Remove whitespace. |
| 781 | dex2oat_cmdline=$(echo $dex2oat_cmdline) |
| 782 | dalvikvm_cmdline=$(echo $dalvikvm_cmdline) |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 783 | dm_cmdline=$(echo $dm_cmdline) |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 784 | vdex_cmdline=$(echo $vdex_cmdline) |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 785 | profman_cmdline=$(echo $profman_cmdline) |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 786 | |
Andreas Gampe | b31a8e7 | 2017-05-16 10:30:24 -0700 | [diff] [blame] | 787 | # Use an empty ASAN_OPTIONS to enable defaults. |
| 788 | # Note: this is required as envsetup right now exports detect_leaks=0. |
| 789 | RUN_TEST_ASAN_OPTIONS="" |
| 790 | |
Andreas Gampe | 5840839 | 2017-05-16 10:45:46 -0700 | [diff] [blame] | 791 | # Multiple shutdown leaks. b/38341789 |
| 792 | if [ "x$RUN_TEST_ASAN_OPTIONS" != "x" ] ; then |
| 793 | RUN_TEST_ASAN_OPTIONS="${RUN_TEST_ASAN_OPTIONS}:" |
| 794 | fi |
| 795 | RUN_TEST_ASAN_OPTIONS="${RUN_TEST_ASAN_OPTIONS}detect_leaks=0" |
| 796 | |
Nicolas Geoffray | f39f04c | 2018-03-05 15:42:11 +0000 | [diff] [blame] | 797 | # For running, we must turn off logging when dex2oat or patchoat are missing. Otherwise we use |
| 798 | # the same defaults as for prebuilt: everything when --dev, otherwise errors and above only. |
| 799 | if [ "$EXTERNAL_LOG_TAGS" = "n" ]; then |
| 800 | if [ "$DEV_MODE" = "y" ]; then |
| 801 | export ANDROID_LOG_TAGS='*:d' |
| 802 | elif [ "$USE_DEX2OAT_AND_PATCHOAT" = "n" ]; then |
| 803 | # All tests would log the error of failing dex2oat/patchoat. Be silent here and only |
| 804 | # log fatal events. |
| 805 | export ANDROID_LOG_TAGS='*:s' |
| 806 | elif [ "$HAVE_IMAGE" = "n" ]; then |
| 807 | # All tests would log the error of missing image. Be silent here and only log fatal |
| 808 | # events. |
| 809 | export ANDROID_LOG_TAGS='*:s' |
| 810 | else |
| 811 | # We are interested in LOG(ERROR) output. |
| 812 | export ANDROID_LOG_TAGS='*:e' |
| 813 | fi |
| 814 | fi |
| 815 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 816 | if [ "$HOST" = "n" ]; then |
| 817 | adb root > /dev/null |
| 818 | adb wait-for-device |
| 819 | if [ "$QUIET" = "n" ]; then |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 820 | adb shell rm -rf $DEX_LOCATION |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 821 | adb shell mkdir -p $DEX_LOCATION |
| 822 | adb push $TEST_NAME.jar $DEX_LOCATION |
| 823 | adb push $TEST_NAME-ex.jar $DEX_LOCATION |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 824 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 825 | adb push profile $DEX_LOCATION |
| 826 | fi |
David Brazdil | 7d2ec61 | 2018-01-19 14:19:59 +0000 | [diff] [blame] | 827 | # Copy resource folder |
| 828 | if [ -d res ]; then |
| 829 | adb push res $DEX_LOCATION |
| 830 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 831 | else |
| 832 | adb shell rm -r $DEX_LOCATION >/dev/null 2>&1 |
| 833 | adb shell mkdir -p $DEX_LOCATION >/dev/null 2>&1 |
| 834 | adb push $TEST_NAME.jar $DEX_LOCATION >/dev/null 2>&1 |
| 835 | adb push $TEST_NAME-ex.jar $DEX_LOCATION >/dev/null 2>&1 |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 836 | if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 837 | adb push profile $DEX_LOCATION >/dev/null 2>&1 |
| 838 | fi |
David Brazdil | 7d2ec61 | 2018-01-19 14:19:59 +0000 | [diff] [blame] | 839 | # Copy resource folder |
| 840 | if [ -d res ]; then |
| 841 | adb push res $DEX_LOCATION >/dev/null 2>&1 |
| 842 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 843 | fi |
| 844 | |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 845 | LD_LIBRARY_PATH=/data/$TEST_DIRECTORY/art/$ISA |
Nicolas Geoffray | eb441dd | 2014-10-31 15:34:50 +0000 | [diff] [blame] | 846 | if [ "$ANDROID_ROOT" != "/system" ]; then |
| 847 | # Current default installation is dalvikvm 64bits and dex2oat 32bits, |
| 848 | # so we can only use LD_LIBRARY_PATH when testing on a local |
| 849 | # installation. |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 850 | LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBRARY_DIRECTORY:$LD_LIBRARY_PATH |
Nicolas Geoffray | eb441dd | 2014-10-31 15:34:50 +0000 | [diff] [blame] | 851 | fi |
| 852 | |
Dimitry Ivanov | 49c2c92 | 2017-02-14 11:06:14 -0800 | [diff] [blame] | 853 | # System libraries needed by libarttestd.so |
Vladimir Marko | 2da72ed | 2018-03-07 12:58:11 +0000 | [diff] [blame] | 854 | PUBLIC_LIBS=libc++.so:libbacktrace.so:libbase.so:libnativehelper.so |
| 855 | if [ "$TEST_IS_NDEBUG" = "y" ]; then |
Nicolas Geoffray | 83b7419 | 2018-04-27 10:58:45 +0100 | [diff] [blame] | 856 | PUBLIC_LIBS=$PUBLIC_LIBS:libart.so:libdexfile.so:libprofile.so |
Vladimir Marko | 2da72ed | 2018-03-07 12:58:11 +0000 | [diff] [blame] | 857 | else |
Nicolas Geoffray | 83b7419 | 2018-04-27 10:58:45 +0100 | [diff] [blame] | 858 | PUBLIC_LIBS=$PUBLIC_LIBS:libartd.so:libdexfiled.so:libprofiled.so |
Vladimir Marko | 2da72ed | 2018-03-07 12:58:11 +0000 | [diff] [blame] | 859 | fi |
Dimitry Ivanov | 90d48f2 | 2016-05-05 17:24:28 -0700 | [diff] [blame] | 860 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 861 | # Create a script with the command. The command can get longer than the longest |
| 862 | # 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] | 863 | # command. Dalvik cache is cleaned before running to make subsequent executions |
| 864 | # of the script follow the same runtime path. |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 865 | cmdline="cd $DEX_LOCATION && \ |
Andreas Gampe | b31a8e7 | 2017-05-16 10:30:24 -0700 | [diff] [blame] | 866 | export ASAN_OPTIONS=$RUN_TEST_ASAN_OPTIONS && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 867 | export ANDROID_DATA=$DEX_LOCATION && \ |
Dimitry Ivanov | 90d48f2 | 2016-05-05 17:24:28 -0700 | [diff] [blame] | 868 | export ANDROID_ADDITIONAL_PUBLIC_LIBRARIES=$PUBLIC_LIBS && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 869 | export DEX_LOCATION=$DEX_LOCATION && \ |
Nicolas Geoffray | c8f23fc | 2014-10-28 17:59:47 +0000 | [diff] [blame] | 870 | export ANDROID_ROOT=$ANDROID_ROOT && \ |
Nicolas Geoffray | f39f04c | 2018-03-05 15:42:11 +0000 | [diff] [blame] | 871 | export ANDROID_LOG_TAGS=$ANDROID_LOG_TAGS && \ |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 872 | rm -rf ${DEX_LOCATION}/dalvik-cache/ && \ |
Alex Light | afb5d19 | 2016-05-24 15:57:45 -0700 | [diff] [blame] | 873 | mkdir -p ${mkdir_locations} && \ |
Sebastien Hertz | 7cde48c | 2015-01-20 16:06:43 +0100 | [diff] [blame] | 874 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH && \ |
Nicolas Geoffray | 4f7fdd2 | 2015-04-24 11:57:37 +0100 | [diff] [blame] | 875 | export PATH=$ANDROID_ROOT/bin:$PATH && \ |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 876 | $profman_cmdline && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 877 | $dex2oat_cmdline && \ |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 878 | $dm_cmdline && \ |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 879 | $vdex_cmdline && \ |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 880 | $strip_cmdline && \ |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 881 | $sync_cmdline && \ |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 882 | $dalvikvm_cmdline" |
| 883 | |
| 884 | cmdfile=$(tempfile -p "cmd-" -s "-$TEST_NAME") |
| 885 | echo "$cmdline" > $cmdfile |
| 886 | |
| 887 | if [ "$DEV_MODE" = "y" ]; then |
| 888 | echo $cmdline |
| 889 | fi |
| 890 | |
| 891 | if [ "$QUIET" = "n" ]; then |
| 892 | adb push $cmdfile $DEX_LOCATION/cmdline.sh |
| 893 | else |
| 894 | adb push $cmdfile $DEX_LOCATION/cmdline.sh > /dev/null 2>&1 |
| 895 | fi |
| 896 | |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 897 | exit_status=0 |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 898 | if [ "$DRY_RUN" != "y" ]; then |
| 899 | adb shell sh $DEX_LOCATION/cmdline.sh |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 900 | exit_status=$? |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 901 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 902 | |
| 903 | rm -f $cmdfile |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 904 | exit $exit_status |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 905 | else |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 906 | # Host run. |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 907 | export ANDROID_PRINTF_LOG=brief |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 908 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 909 | export ANDROID_DATA="$DEX_LOCATION" |
Nicolas Geoffray | 8eedb47 | 2014-10-29 14:05:59 +0000 | [diff] [blame] | 910 | export ANDROID_ROOT="${ANDROID_ROOT}" |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 911 | export LD_LIBRARY_PATH="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" |
| 912 | export DYLD_LIBRARY_PATH="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 913 | export PATH="$PATH:${ANDROID_ROOT}/bin" |
| 914 | |
David Srbecky | c9ede38 | 2015-06-20 06:03:53 +0100 | [diff] [blame] | 915 | # Temporarily disable address space layout randomization (ASLR). |
| 916 | # This is needed on the host so that the linker loads core.oat at the necessary address. |
| 917 | export LD_USE_LOAD_BIAS=1 |
| 918 | |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 919 | cmdline="$dalvikvm_cmdline" |
| 920 | |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 921 | if [ "$TIME_OUT" = "gdb" ]; then |
| 922 | if [ `uname` = "Darwin" ]; then |
| 923 | # Fall back to timeout on Mac. |
| 924 | TIME_OUT="timeout" |
Hiroshi Yamauchi | c823eff | 2015-09-01 16:21:35 -0700 | [diff] [blame] | 925 | elif [ "$ISA" = "x86" ]; then |
| 926 | # prctl call may fail in 32-bit on an older (3.2) 64-bit Linux kernel. Fall back to timeout. |
| 927 | TIME_OUT="timeout" |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 928 | else |
| 929 | # Check if gdb is available. |
| 930 | gdb --eval-command="quit" > /dev/null 2>&1 |
| 931 | if [ $? != 0 ]; then |
| 932 | # gdb isn't available. Fall back to timeout. |
| 933 | TIME_OUT="timeout" |
| 934 | fi |
| 935 | fi |
| 936 | fi |
| 937 | |
| 938 | if [ "$TIME_OUT" = "timeout" ]; then |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 939 | # Add timeout command if time out is desired. |
Andreas Gampe | 038bb22 | 2015-01-13 19:48:14 -0800 | [diff] [blame] | 940 | # |
Andreas Gampe | 6fb9256 | 2016-08-01 21:53:57 -0700 | [diff] [blame] | 941 | # Note: We first send SIGRTMIN+2 (usually 36) to ART, which will induce a full thread dump |
| 942 | # before abort. However, dumping threads might deadlock, so we also use the "-k" |
| 943 | # option to definitely kill the child. |
| 944 | cmdline="timeout -k 120s -s SIGRTMIN+2 ${TIME_OUT_VALUE}s $cmdline" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 945 | fi |
| 946 | |
| 947 | if [ "$DEV_MODE" = "y" ]; then |
Orion Hodson | ee06c5a | 2018-04-23 13:46:24 +0100 | [diff] [blame] | 948 | for var in ANDROID_PRINTF_LOG ANDROID_DATA ANDROID_ROOT LD_LIBRARY_PATH DYLD_LIBRARY_PATH PATH LD_USE_LOAD_BIAS; do |
| 949 | echo EXPORT $var=${!var} |
| 950 | done |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 951 | echo "mkdir -p ${mkdir_locations} && $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] | 952 | fi |
| 953 | |
| 954 | cd $ANDROID_BUILD_TOP |
| 955 | |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 956 | # Make sure we delete any existing compiler artifacts. |
| 957 | # This enables tests to call the RUN script multiple times in a row |
| 958 | # without worrying about interference. |
| 959 | rm -rf ${DEX_LOCATION}/oat |
David Srbecky | 2e4afe8 | 2016-01-27 18:42:06 +0000 | [diff] [blame] | 960 | rm -rf ${DEX_LOCATION}/dalvik-cache/ |
Calin Juravle | 24bd3f9 | 2017-05-11 00:36:53 -0700 | [diff] [blame] | 961 | |
Andreas Gampe | b31a8e7 | 2017-05-16 10:30:24 -0700 | [diff] [blame] | 962 | export ASAN_OPTIONS=$RUN_TEST_ASAN_OPTIONS |
| 963 | |
Alex Light | afb5d19 | 2016-05-24 15:57:45 -0700 | [diff] [blame] | 964 | mkdir -p ${mkdir_locations} || exit 1 |
Calin Juravle | 13439f0 | 2017-02-21 01:17:21 -0800 | [diff] [blame] | 965 | $profman_cmdline || { echo "Profman failed." >&2 ; exit 2; } |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 966 | $dex2oat_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } |
Nicolas Geoffray | baeaa9b | 2018-01-26 14:31:17 +0000 | [diff] [blame] | 967 | $dm_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } |
Nicolas Geoffray | b0bbe8e | 2016-11-19 10:42:37 +0000 | [diff] [blame] | 968 | $vdex_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } |
Richard Uhler | 76f5cb6 | 2016-04-04 13:30:16 -0700 | [diff] [blame] | 969 | $strip_cmdline || { echo "Strip failed." >&2 ; exit 3; } |
Igor Murashkin | 271a0f8 | 2017-02-14 21:14:17 +0000 | [diff] [blame] | 970 | $sync_cmdline || { echo "Sync failed." >&2 ; exit 4; } |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 971 | |
Wojciech Staszkiewicz | d7a819a | 2016-09-01 14:43:39 -0700 | [diff] [blame] | 972 | if [ "$DRY_RUN" = "y" ]; then |
| 973 | exit 0 |
Andreas Gampe | a878082 | 2015-03-13 19:51:09 -0700 | [diff] [blame] | 974 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 975 | |
| 976 | if [ "$USE_GDB" = "y" ]; then |
| 977 | # When running under gdb, we cannot do piping and grepping... |
Dmitriy Ivanov | f57874d | 2014-10-07 13:43:23 -0700 | [diff] [blame] | 978 | $cmdline "$@" |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 979 | else |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 980 | if [ "$TIME_OUT" != "gdb" ]; then |
| 981 | trap 'kill -INT -$pid' INT |
| 982 | $cmdline "$@" 2>&1 & pid=$! |
| 983 | wait $pid |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 984 | exit_value=$? |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 985 | # Add extra detail if time out is enabled. |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 986 | if [ $exit_value = 124 ] && [ "$TIME_OUT" = "timeout" ]; then |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 987 | echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 |
| 988 | fi |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 989 | exit $exit_value |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 990 | else |
| 991 | # With a thread dump that uses gdb if a timeout. |
| 992 | trap 'kill -INT -$pid' INT |
| 993 | $cmdline "$@" 2>&1 & pid=$! |
| 994 | # Spawn a watcher process. |
| 995 | ( sleep $TIME_OUT_VALUE && \ |
| 996 | echo "##### Thread dump using gdb on test timeout" && \ |
| 997 | ( gdb -q -p $pid --eval-command="info thread" --eval-command="thread apply all bt" \ |
| 998 | --eval-command="call exit(124)" --eval-command=quit || \ |
| 999 | kill $pid )) 2> /dev/null & watcher=$! |
| 1000 | wait $pid |
| 1001 | test_exit_status=$? |
| 1002 | pkill -P $watcher 2> /dev/null # kill the sleep which will in turn end the watcher as well |
| 1003 | if [ $test_exit_status = 0 ]; then |
| 1004 | # The test finished normally. |
| 1005 | exit 0 |
| 1006 | else |
| 1007 | # The test failed or timed out. |
| 1008 | if [ $test_exit_status = 124 ]; then |
| 1009 | # The test timed out. |
| 1010 | echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 |
| 1011 | fi |
Alex Light | 722d671 | 2018-02-12 17:41:12 +0000 | [diff] [blame] | 1012 | exit $test_exit_status |
Hiroshi Yamauchi | 6ffb9cc | 2015-08-31 15:14:17 -0700 | [diff] [blame] | 1013 | fi |
Nicolas Geoffray | 1a58b7f | 2014-10-06 12:23:04 +0100 | [diff] [blame] | 1014 | fi |
| 1015 | fi |
| 1016 | fi |