OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 import collections | 6 import collections |
7 import glob | 7 import glob |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import optparse | 10 import optparse |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if suite.is_suite_exe: | 139 if suite.is_suite_exe: |
140 cmd.append('--exe') | 140 cmd.append('--exe') |
141 RunCmd(cmd) | 141 RunCmd(cmd) |
142 | 142 |
143 def RunBrowserTestSuite(options): | 143 def RunBrowserTestSuite(options): |
144 """Manages an invocation of run_browser_tests.py. | 144 """Manages an invocation of run_browser_tests.py. |
145 | 145 |
146 Args: | 146 Args: |
147 options: options object. | 147 options: options object. |
148 """ | 148 """ |
149 args = ['--verbose'] | 149 args = ['--verbose', '--num_retries=1'] |
150 if options.target == 'Release': | 150 if options.target == 'Release': |
151 args.append('--release') | 151 args.append('--release') |
152 if options.asan: | 152 if options.asan: |
153 args.append('--tool=asan') | 153 args.append('--tool=asan') |
154 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) | 154 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) |
155 RunCmd(['build/android/run_browser_tests.py'] + args) | 155 RunCmd(['build/android/run_browser_tests.py'] + args) |
156 | 156 |
157 def RunChromeDriverTests(): | 157 def RunChromeDriverTests(): |
158 """Run all the steps for running chromedriver tests.""" | 158 """Run all the steps for running chromedriver tests.""" |
159 buildbot_report.PrintNamedStep('chromedriver_annotation') | 159 buildbot_report.PrintNamedStep('chromedriver_annotation') |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 RunCmd(['build/android/provision_devices.py', '-t', target]) | 277 RunCmd(['build/android/provision_devices.py', '-t', target]) |
278 | 278 |
279 if options.install: | 279 if options.install: |
280 test_obj = INSTRUMENTATION_TESTS[options.install] | 280 test_obj = INSTRUMENTATION_TESTS[options.install] |
281 InstallApk(options, test_obj, print_step=True) | 281 InstallApk(options, test_obj, print_step=True) |
282 | 282 |
283 if 'chromedriver' in options.test_filter: | 283 if 'chromedriver' in options.test_filter: |
284 RunChromeDriverTests() | 284 RunChromeDriverTests() |
285 if 'unit' in options.test_filter: | 285 if 'unit' in options.test_filter: |
286 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) | 286 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
| 287 RunBrowserTestSuite(options) |
287 if 'ui' in options.test_filter: | 288 if 'ui' in options.test_filter: |
288 for test in INSTRUMENTATION_TESTS.itervalues(): | 289 for test in INSTRUMENTATION_TESTS.itervalues(): |
289 RunInstrumentationSuite(options, test) | 290 RunInstrumentationSuite(options, test) |
290 if 'webkit' in options.test_filter: | 291 if 'webkit' in options.test_filter: |
291 RunTestSuites(options, [ | 292 RunTestSuites(options, [ |
292 gtest_config.Apk('webkit_unit_tests'), | 293 gtest_config.Apk('webkit_unit_tests'), |
293 gtest_config.Apk('TestWebKitAPI'), | 294 gtest_config.Apk('TestWebKitAPI'), |
294 ]) | 295 ]) |
295 RunWebkitLint(options.target) | 296 RunWebkitLint(options.target) |
296 if 'webkit_layout' in options.test_filter: | 297 if 'webkit_layout' in options.test_filter: |
297 RunWebkitLayoutTests(options) | 298 RunWebkitLayoutTests(options) |
298 | 299 |
299 if options.experimental: | 300 if options.experimental: |
300 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) | 301 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
301 RunBrowserTestSuite(options) | |
302 | 302 |
303 # Print logcat, kill logcat monitor | 303 # Print logcat, kill logcat monitor |
304 buildbot_report.PrintNamedStep('logcat_dump') | 304 buildbot_report.PrintNamedStep('logcat_dump') |
305 RunCmd(['build/android/adb_logcat_printer.py', logcat_dir]) | 305 RunCmd(['build/android/adb_logcat_printer.py', logcat_dir]) |
306 | 306 |
307 buildbot_report.PrintNamedStep('test_report') | 307 buildbot_report.PrintNamedStep('test_report') |
308 for report in glob.glob( | 308 for report in glob.glob( |
309 os.path.join(CHROME_SRC, 'out', options.target, 'test_logs', '*.log')): | 309 os.path.join(CHROME_SRC, 'out', options.target, 'test_logs', '*.log')): |
310 RunCmd(['cat', report]) | 310 RunCmd(['cat', report]) |
311 os.remove(report) | 311 os.remove(report) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 'slave', 'android')) | 368 'slave', 'android')) |
369 if os.path.exists(build_internal_android): | 369 if os.path.exists(build_internal_android): |
370 android_paths.insert(0, build_internal_android) | 370 android_paths.insert(0, build_internal_android) |
371 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) | 371 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) |
372 | 372 |
373 MainTestWrapper(options) | 373 MainTestWrapper(options) |
374 | 374 |
375 | 375 |
376 if __name__ == '__main__': | 376 if __name__ == '__main__': |
377 sys.exit(main(sys.argv)) | 377 sys.exit(main(sys.argv)) |
OLD | NEW |