| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | 5 # |
| 6 # Bash functions used by buildbot annotator scripts for the android | 6 # Bash functions used by buildbot annotator scripts for the android |
| 7 # build of chromium. Executing this script should not perform actions | 7 # build of chromium. Executing this script should not perform actions |
| 8 # other than setting variables and defining of functions. | 8 # other than setting variables and defining of functions. |
| 9 | 9 |
| 10 # Number of jobs on the compile line; e.g. make -j"${JOBS}" | 10 # Number of jobs on the compile line; e.g. make -j"${JOBS}" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 set -e | 189 set -e |
| 190 done | 190 done |
| 191 } | 191 } |
| 192 | 192 |
| 193 # Run tests on an emulator. | 193 # Run tests on an emulator. |
| 194 function bb_run_tests_emulator { | 194 function bb_run_tests_emulator { |
| 195 echo "@@@BUILD_STEP Run Tests on an Emulator@@@" | 195 echo "@@@BUILD_STEP Run Tests on an Emulator@@@" |
| 196 build/android/run_tests.py -e --xvfb --verbose | 196 build/android/run_tests.py -e --xvfb --verbose |
| 197 } | 197 } |
| 198 | 198 |
| 199 function bb_spawn_logcat_monitor_and_status { |
| 200 python build/android/device_status_check.py |
| 201 local LOGCAT_DUMP_DIR="$CHROME_SRC/out/logcat" |
| 202 rm -rf "$LOGCAT_DUMP_DIR" |
| 203 python build/android/adb_logcat_monitor.py "$LOGCAT_DUMP_DIR" & |
| 204 } |
| 205 |
| 206 function bb_print_logcat { |
| 207 echo "@@@BUILD_STEP Logcat dump@@@" |
| 208 python build/android/adb_logcat_printer.py "$LOGCAT_DUMP_DIR" |
| 209 } |
| 210 |
| 199 # Run tests on an actual device. (Better have one plugged in!) | 211 # Run tests on an actual device. (Better have one plugged in!) |
| 200 function bb_run_unit_tests { | 212 function bb_run_unit_tests { |
| 201 python build/android/device_status_check.py | |
| 202 local LOGCAT_DUMP_DIR="$CHROME_SRC/out/logcat" | |
| 203 rm -rf "$LOGCAT_DUMP_DIR" | |
| 204 python build/android/adb_logcat_monitor.py "$LOGCAT_DUMP_DIR" & | |
| 205 | |
| 206 build/android/run_tests.py --xvfb --verbose | 213 build/android/run_tests.py --xvfb --verbose |
| 207 | |
| 208 echo "@@@BUILD_STEP Logcat dump@@@" | |
| 209 python build/android/adb_logcat_printer.py "$LOGCAT_DUMP_DIR" | |
| 210 } | 214 } |
| 211 | 215 |
| 212 # Run instrumentation test. | 216 # Run instrumentation test. |
| 213 # Args: | 217 # Args: |
| 214 # $1: TEST_APK. | 218 # $1: TEST_APK. |
| 215 # $2: EXTRA_FLAGS to be passed to run_instrumentation_tests.py. | 219 # $2: EXTRA_FLAGS to be passed to run_instrumentation_tests.py. |
| 216 function bb_run_instrumentation_test { | 220 function bb_run_instrumentation_test { |
| 217 local TEST_APK=${1} | 221 local TEST_APK=${1} |
| 218 local EXTRA_FLAGS=${2} | 222 local EXTRA_FLAGS=${2} |
| 219 local INSTRUMENTATION_FLAGS="-vvv" | 223 local INSTRUMENTATION_FLAGS="-vvv" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 ) | 306 ) |
| 303 } | 307 } |
| 304 | 308 |
| 305 # Retrieve a packed json property using python | 309 # Retrieve a packed json property using python |
| 306 function bb_get_json_prop { | 310 function bb_get_json_prop { |
| 307 local JSON="$1" | 311 local JSON="$1" |
| 308 local PROP="$2" | 312 local PROP="$2" |
| 309 | 313 |
| 310 python -c "import json; print json.loads('$JSON').get('$PROP')" | 314 python -c "import json; print json.loads('$JSON').get('$PROP')" |
| 311 } | 315 } |
| OLD | NEW |