[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | import collections |
| 7 | import glob |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 8 | import multiprocessing |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 9 | import os |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 10 | import shutil |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 11 | import sys |
| 12 | |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 13 | import bb_utils |
| 14 | |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 15 | sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 16 | from pylib import android_commands |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 17 | from pylib import buildbot_report |
| 18 | from pylib import constants |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 19 | from pylib.gtest import gtest_config |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 20 | |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 21 | sys.path.append(os.path.join( |
[email protected] | b3c0d4a | 2013-06-05 23:28:09 | [diff] [blame] | 22 | constants.DIR_SOURCE_ROOT, 'third_party', 'android_testrunner')) |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 23 | import errors |
| 24 | |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 25 | |
[email protected] | b3c0d4a | 2013-06-05 23:28:09 | [diff] [blame] | 26 | CHROME_SRC = constants.DIR_SOURCE_ROOT |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 27 | |
| 28 | # Describes an instrumation test suite: |
| 29 | # test: Name of test we're running. |
| 30 | # apk: apk to be installed. |
| 31 | # apk_package: package for the apk to be installed. |
| 32 | # test_apk: apk to run tests on. |
| 33 | # test_data: data folder in format destination:source. |
| 34 | I_TEST = collections.namedtuple('InstrumentationTest', [ |
[email protected] | 8d8ca04 | 2013-02-14 19:29:17 | [diff] [blame] | 35 | 'name', 'apk', 'apk_package', 'test_apk', 'test_data', 'host_driven_root']) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 36 | |
| 37 | INSTRUMENTATION_TESTS = dict((suite.name, suite) for suite in [ |
| 38 | I_TEST('ContentShell', |
| 39 | 'ContentShell.apk', |
[email protected] | 4d4eb5b | 2013-01-29 21:55:55 | [diff] [blame] | 40 | 'org.chromium.content_shell_apk', |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 41 | 'ContentShellTest', |
[email protected] | 8d8ca04 | 2013-02-14 19:29:17 | [diff] [blame] | 42 | 'content:content/test/data/android/device_files', |
| 43 | None), |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 44 | I_TEST('ChromiumTestShell', |
| 45 | 'ChromiumTestShell.apk', |
| 46 | 'org.chromium.chrome.testshell', |
| 47 | 'ChromiumTestShellTest', |
[email protected] | 8d8ca04 | 2013-02-14 19:29:17 | [diff] [blame] | 48 | 'chrome:chrome/test/data/android/device_files', |
| 49 | constants.CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR), |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 50 | I_TEST('AndroidWebView', |
| 51 | 'AndroidWebView.apk', |
[email protected] | 8c56afd | 2013-03-25 15:37:45 | [diff] [blame] | 52 | 'org.chromium.android_webview.shell', |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 53 | 'AndroidWebViewTest', |
[email protected] | 8d8ca04 | 2013-02-14 19:29:17 | [diff] [blame] | 54 | 'webview:android_webview/test/data/device_files', |
| 55 | None), |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 56 | ]) |
| 57 | |
[email protected] | d8897f6c | 2013-03-05 00:27:16 | [diff] [blame] | 58 | VALID_TESTS = set(['chromedriver', 'ui', 'unit', 'webkit', 'webkit_layout']) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 59 | |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 60 | RunCmd = bb_utils.RunCmd |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 61 | |
| 62 | |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 63 | # multiprocessing map_async requires a top-level function for pickle library. |
| 64 | def RebootDeviceSafe(device): |
| 65 | """Reboot a device, wait for it to start, and squelch timeout exceptions.""" |
| 66 | try: |
| 67 | android_commands.AndroidCommands(device).Reboot(True) |
| 68 | except errors.DeviceUnresponsiveError as e: |
| 69 | return e |
| 70 | |
| 71 | |
| 72 | def RebootDevices(): |
| 73 | """Reboot all attached and online devices.""" |
| 74 | buildbot_report.PrintNamedStep('Reboot devices') |
[email protected] | c94ae6b | 2013-01-14 21:38:34 | [diff] [blame] | 75 | # Early return here to avoid presubmit dependence on adb, |
| 76 | # which might not exist in this checkout. |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 77 | if bb_utils.TESTING: |
[email protected] | c94ae6b | 2013-01-14 21:38:34 | [diff] [blame] | 78 | return |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 79 | devices = android_commands.GetAttachedDevices() |
| 80 | print 'Rebooting: %s' % devices |
[email protected] | c94ae6b | 2013-01-14 21:38:34 | [diff] [blame] | 81 | if devices: |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 82 | pool = multiprocessing.Pool(len(devices)) |
| 83 | results = pool.map_async(RebootDeviceSafe, devices).get(99999) |
| 84 | |
| 85 | for device, result in zip(devices, results): |
| 86 | if result: |
| 87 | print '%s failed to startup.' % device |
| 88 | |
| 89 | if any(results): |
| 90 | buildbot_report.PrintWarning() |
| 91 | else: |
| 92 | print 'Reboots complete.' |
| 93 | |
| 94 | |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 95 | def RunTestSuites(options, suites): |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 96 | """Manages an invocation of run_tests.py. |
| 97 | |
| 98 | Args: |
| 99 | options: options object. |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 100 | suites: List of suites to run. |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 101 | """ |
| 102 | args = ['--verbose'] |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 103 | if options.target == 'Release': |
| 104 | args.append('--release') |
| 105 | if options.asan: |
| 106 | args.append('--tool=asan') |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 107 | for suite in suites: |
[email protected] | 9324bff | 2013-03-13 04:09:27 | [diff] [blame] | 108 | buildbot_report.PrintNamedStep(suite.name) |
| 109 | cmd = ['build/android/run_tests.py', '-s', suite.name] + args |
| 110 | if suite.is_suite_exe: |
| 111 | cmd.append('--exe') |
| 112 | RunCmd(cmd) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 113 | |
[email protected] | 2b5decc | 2013-03-02 18:09:15 | [diff] [blame] | 114 | def RunBrowserTestSuite(options): |
| 115 | """Manages an invocation of run_browser_tests.py. |
| 116 | |
| 117 | Args: |
| 118 | options: options object. |
| 119 | """ |
[email protected] | a61af45 | 2013-05-07 18:39:18 | [diff] [blame] | 120 | args = ['--verbose'] |
[email protected] | 2b5decc | 2013-03-02 18:09:15 | [diff] [blame] | 121 | if options.target == 'Release': |
| 122 | args.append('--release') |
| 123 | if options.asan: |
| 124 | args.append('--tool=asan') |
| 125 | buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) |
| 126 | RunCmd(['build/android/run_browser_tests.py'] + args) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 127 | |
[email protected] | d8897f6c | 2013-03-05 00:27:16 | [diff] [blame] | 128 | def RunChromeDriverTests(): |
| 129 | """Run all the steps for running chromedriver tests.""" |
| 130 | buildbot_report.PrintNamedStep('chromedriver_annotation') |
| 131 | RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', |
| 132 | '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) |
| 133 | |
[email protected] | a2a72524 | 2013-01-09 21:52:57 | [diff] [blame] | 134 | def InstallApk(options, test, print_step=False): |
| 135 | """Install an apk to all phones. |
| 136 | |
| 137 | Args: |
| 138 | options: options object |
| 139 | test: An I_TEST namedtuple |
| 140 | print_step: Print a buildbot step |
| 141 | """ |
| 142 | if print_step: |
| 143 | buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) |
| 144 | args = ['--apk', test.apk, '--apk_package', test.apk_package] |
| 145 | if options.target == 'Release': |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 146 | args.append('--release') |
| 147 | |
[email protected] | 800673bf | 2013-05-14 17:15:30 | [diff] [blame] | 148 | RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 149 | |
| 150 | |
| 151 | def RunInstrumentationSuite(options, test): |
| 152 | """Manages an invocation of run_instrumentaiton_tests.py. |
| 153 | |
| 154 | Args: |
| 155 | options: options object |
| 156 | test: An I_TEST namedtuple |
| 157 | """ |
| 158 | buildbot_report.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) |
| 159 | |
[email protected] | a2a72524 | 2013-01-09 21:52:57 | [diff] [blame] | 160 | InstallApk(options, test) |
[email protected] | d1a0657c | 2013-04-10 22:38:59 | [diff] [blame] | 161 | args = ['--test-apk', test.test_apk, '--test_data', test.test_data, |
| 162 | '--verbose', '-I'] |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 163 | if options.target == 'Release': |
| 164 | args.append('--release') |
| 165 | if options.asan: |
| 166 | args.append('--tool=asan') |
[email protected] | da06cc5 | 2013-01-16 18:58:41 | [diff] [blame] | 167 | if options.upload_to_flakiness_server: |
[email protected] | b796a77 | 2013-01-19 03:55:22 | [diff] [blame] | 168 | args.append('--flakiness-dashboard-server=%s' % |
| 169 | constants.UPSTREAM_FLAKINESS_SERVER) |
[email protected] | 8d8ca04 | 2013-02-14 19:29:17 | [diff] [blame] | 170 | if test.host_driven_root: |
| 171 | args.append('--python_test_root=%s' % test.host_driven_root) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 172 | |
| 173 | RunCmd(['build/android/run_instrumentation_tests.py'] + args) |
| 174 | |
| 175 | |
| 176 | def RunWebkitLint(target): |
| 177 | """Lint WebKit's TestExpectation files.""" |
| 178 | buildbot_report.PrintNamedStep('webkit_lint') |
| 179 | RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', |
| 180 | '--lint-test-files', |
| 181 | '--chromium', |
| 182 | '--target', target]) |
| 183 | |
| 184 | |
| 185 | def RunWebkitLayoutTests(options): |
| 186 | """Run layout tests on an actual device.""" |
| 187 | buildbot_report.PrintNamedStep('webkit_tests') |
[email protected] | 22ee700 | 2013-01-23 20:58:04 | [diff] [blame] | 188 | cmd_args = [ |
| 189 | '--no-show-results', |
| 190 | '--no-new-test-results', |
| 191 | '--full-results-html', |
| 192 | '--clobber-old-results', |
| 193 | '--exit-after-n-failures', '5000', |
| 194 | '--exit-after-n-crashes-or-timeouts', '100', |
| 195 | '--debug-rwt-logging', |
| 196 | '--results-directory', '..layout-test-results', |
| 197 | '--target', options.target, |
| 198 | '--builder-name', options.build_properties.get('buildername', ''), |
[email protected] | 0b793d6 | 2013-05-20 22:00:39 | [diff] [blame] | 199 | '--build-number', str(options.build_properties.get('buildnumber', '')), |
[email protected] | 22ee700 | 2013-01-23 20:58:04 | [diff] [blame] | 200 | '--master-name', options.build_properties.get('mastername', ''), |
| 201 | '--build-name', options.build_properties.get('buildername', ''), |
| 202 | '--platform=chromium-android'] |
| 203 | |
| 204 | for flag in 'test_results_server', 'driver_name', 'additional_drt_flag': |
| 205 | if flag in options.factory_properties: |
| 206 | cmd_args.extend(['--%s' % flag.replace('_', '-'), |
| 207 | options.factory_properties.get(flag)]) |
| 208 | |
[email protected] | 2c39b29 | 2013-03-20 09:34:10 | [diff] [blame] | 209 | for f in options.factory_properties.get('additional_expectations', []): |
| 210 | cmd_args.extend( |
| 211 | ['--additional-expectations=%s' % os.path.join(CHROME_SRC, *f)]) |
| 212 | |
| 213 | # TODO(dpranke): Remove this block after |
| 214 | # https://codereview.chromium.org/12927002/ lands. |
[email protected] | 22ee700 | 2013-01-23 20:58:04 | [diff] [blame] | 215 | for f in options.factory_properties.get('additional_expectations_files', []): |
[email protected] | 62c5b98 | 2013-01-26 08:23:16 | [diff] [blame] | 216 | cmd_args.extend( |
| 217 | ['--additional-expectations=%s' % os.path.join(CHROME_SRC, *f)]) |
[email protected] | 22ee700 | 2013-01-23 20:58:04 | [diff] [blame] | 218 | |
[email protected] | 8feb367 | 2013-03-24 00:28:35 | [diff] [blame] | 219 | RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py'] + cmd_args, |
| 220 | flunk_on_failure=False) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 221 | |
| 222 | |
| 223 | def MainTestWrapper(options): |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 224 | # Restart adb to work around bugs, sleep to wait for usb discovery. |
| 225 | RunCmd(['adb', 'kill-server']) |
| 226 | RunCmd(['adb', 'start-server']) |
| 227 | RunCmd(['sleep', '1']) |
| 228 | |
| 229 | # Spawn logcat monitor |
| 230 | logcat_dir = os.path.join(CHROME_SRC, 'out/logcat') |
| 231 | shutil.rmtree(logcat_dir, ignore_errors=True) |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 232 | bb_utils.SpawnCmd(['build/android/adb_logcat_monitor.py', logcat_dir]) |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 233 | |
| 234 | # Wait for logcat_monitor to pull existing logcat |
| 235 | RunCmd(['sleep', '5']) |
| 236 | |
| 237 | if options.reboot: |
| 238 | RebootDevices() |
| 239 | |
[email protected] | 693c54d | 2013-01-09 19:41:25 | [diff] [blame] | 240 | # Device check and alert emails |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 241 | buildbot_report.PrintNamedStep('device_status_check') |
[email protected] | 800673bf | 2013-05-14 17:15:30 | [diff] [blame] | 242 | RunCmd(['build/android/device_status_check.py'], halt_on_failure=True) |
[email protected] | 693c54d | 2013-01-09 19:41:25 | [diff] [blame] | 243 | |
[email protected] | 12f36c8 | 2013-03-29 06:21:13 | [diff] [blame] | 244 | # Provision devices |
[email protected] | c89aae0 | 2013-04-06 00:25:19 | [diff] [blame] | 245 | buildbot_report.PrintNamedStep('provision_devices') |
| 246 | target = options.factory_properties.get('target', 'Debug') |
| 247 | RunCmd(['build/android/provision_devices.py', '-t', target]) |
[email protected] | 12f36c8 | 2013-03-29 06:21:13 | [diff] [blame] | 248 | |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 249 | if options.install: |
| 250 | test_obj = INSTRUMENTATION_TESTS[options.install] |
[email protected] | a2a72524 | 2013-01-09 21:52:57 | [diff] [blame] | 251 | InstallApk(options, test_obj, print_step=True) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 252 | |
[email protected] | d8897f6c | 2013-03-05 00:27:16 | [diff] [blame] | 253 | if 'chromedriver' in options.test_filter: |
| 254 | RunChromeDriverTests() |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 255 | if 'unit' in options.test_filter: |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 256 | RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 257 | if 'ui' in options.test_filter: |
| 258 | for test in INSTRUMENTATION_TESTS.itervalues(): |
| 259 | RunInstrumentationSuite(options, test) |
| 260 | if 'webkit' in options.test_filter: |
[email protected] | 9324bff | 2013-03-13 04:09:27 | [diff] [blame] | 261 | RunTestSuites(options, [ |
| 262 | gtest_config.Apk('webkit_unit_tests'), |
[email protected] | 9324bff | 2013-03-13 04:09:27 | [diff] [blame] | 263 | ]) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 264 | RunWebkitLint(options.target) |
| 265 | if 'webkit_layout' in options.test_filter: |
| 266 | RunWebkitLayoutTests(options) |
| 267 | |
| 268 | if options.experimental: |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 269 | RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
[email protected] | a61af45 | 2013-05-07 18:39:18 | [diff] [blame] | 270 | RunBrowserTestSuite(options) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 271 | |
| 272 | # Print logcat, kill logcat monitor |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 273 | buildbot_report.PrintNamedStep('logcat_dump') |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 274 | RunCmd(['build/android/adb_logcat_printer.py', logcat_dir]) |
| 275 | |
[email protected] | a8fea93f | 2013-01-10 04:00:07 | [diff] [blame] | 276 | buildbot_report.PrintNamedStep('test_report') |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 277 | for report in glob.glob( |
| 278 | os.path.join(CHROME_SRC, 'out', options.target, 'test_logs', '*.log')): |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 279 | RunCmd(['cat', report]) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 280 | os.remove(report) |
| 281 | |
| 282 | |
| 283 | def main(argv): |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 284 | parser = bb_utils.GetParser() |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 285 | parser.add_option('--experimental', action='store_true', |
| 286 | help='Run experiemental tests') |
| 287 | parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], |
| 288 | action='append', |
| 289 | help=('Run a test suite. Test suites: "%s"' % |
| 290 | '", "'.join(VALID_TESTS))) |
| 291 | parser.add_option('--asan', action='store_true', help='Run tests with asan.') |
| 292 | parser.add_option('--install', metavar='<apk name>', |
| 293 | help='Install an apk by name') |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 294 | parser.add_option('--reboot', action='store_true', |
| 295 | help='Reboot devices before running tests') |
[email protected] | da06cc5 | 2013-01-16 18:58:41 | [diff] [blame] | 296 | parser.add_option('--upload-to-flakiness-server', action='store_true', |
| 297 | help='Upload the results to the flakiness dashboard.') |
[email protected] | 12f36c8 | 2013-03-29 06:21:13 | [diff] [blame] | 298 | parser.add_option( |
| 299 | '--auto-reconnect', action='store_true', |
| 300 | help='Push script to device which restarts adbd on disconnections.') |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 301 | options, args = parser.parse_args(argv[1:]) |
| 302 | |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 303 | if args: |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 304 | return sys.exit('Unused args %s' % args) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 305 | |
| 306 | unknown_tests = set(options.test_filter) - VALID_TESTS |
| 307 | if unknown_tests: |
[email protected] | c528275 | 2013-06-07 23:14:39 | [diff] [blame^] | 308 | return sys.exit('Unknown tests %s' % list(unknown_tests)) |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 309 | |
| 310 | setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 311 | |
[email protected] | 78af871 | 2013-01-14 10:37:12 | [diff] [blame] | 312 | # Add adb binary and chromium-source platform-tools to tip of PATH variable. |
| 313 | android_paths = [os.path.join(constants.ANDROID_SDK_ROOT, 'platform-tools')] |
| 314 | |
| 315 | # Bots checkout chrome in /b/build/slave/<name>/build/src |
| 316 | build_internal_android = os.path.abspath(os.path.join( |
| 317 | CHROME_SRC, '..', '..', '..', '..', '..', 'build_internal', 'scripts', |
| 318 | 'slave', 'android')) |
| 319 | if os.path.exists(build_internal_android): |
| 320 | android_paths.insert(0, build_internal_android) |
| 321 | os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) |
| 322 | |
[email protected] | e185b7e8 | 2013-01-09 03:49:57 | [diff] [blame] | 323 | MainTestWrapper(options) |
| 324 | |
| 325 | |
| 326 | if __name__ == '__main__': |
| 327 | sys.exit(main(sys.argv)) |