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 hashlib | 8 import hashlib |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 InstallablePackage = collections.namedtuple('InstallablePackage', [ | 87 InstallablePackage = collections.namedtuple('InstallablePackage', [ |
88 'name', 'apk', 'apk_package']) | 88 'name', 'apk', 'apk_package']) |
89 | 89 |
90 INSTALLABLE_PACKAGES = dict((package.name, package) for package in ( | 90 INSTALLABLE_PACKAGES = dict((package.name, package) for package in ( |
91 [InstallablePackage(i.name, i.apk, i.apk_package) | 91 [InstallablePackage(i.name, i.apk, i.apk_package) |
92 for i in INSTRUMENTATION_TESTS.itervalues()] + | 92 for i in INSTRUMENTATION_TESTS.itervalues()] + |
93 [InstallablePackage('ChromeDriverWebViewShell', | 93 [InstallablePackage('ChromeDriverWebViewShell', |
94 'ChromeDriverWebViewShell.apk', | 94 'ChromeDriverWebViewShell.apk', |
95 'org.chromium.chromedriver_webview_shell')])) | 95 'org.chromium.chromedriver_webview_shell')])) |
96 | 96 |
97 VALID_TESTS = set(['chromedriver', 'chrome_proxy', 'components_browsertests', | 97 VALID_TESTS = set([ |
98 'gpu', 'python_unittests', 'telemetry_unittests', | 98 'base_junit_tests', |
99 'telemetry_perf_unittests', 'ui', 'unit', 'webkit', | 99 'chromedriver', |
100 'webkit_layout']) | 100 'chrome_proxy', |
| 101 'components_browsertests', |
| 102 'gfx_unittests', |
| 103 'gl_unittests', |
| 104 'gpu', |
| 105 'python_unittests', |
| 106 'telemetry_unittests', |
| 107 'telemetry_perf_unittests', |
| 108 'ui', |
| 109 'unit', |
| 110 'webkit', |
| 111 'webkit_layout' |
| 112 ]) |
101 | 113 |
102 RunCmd = bb_utils.RunCmd | 114 RunCmd = bb_utils.RunCmd |
103 | 115 |
104 | 116 |
105 def _GetRevision(options): | 117 def _GetRevision(options): |
106 """Get the SVN revision number. | 118 """Get the SVN revision number. |
107 | 119 |
108 Args: | 120 Args: |
109 options: options object. | 121 options: options object. |
110 | 122 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 183 |
172 for suite in suites: | 184 for suite in suites: |
173 bb_annotations.PrintNamedStep(suite) | 185 bb_annotations.PrintNamedStep(suite) |
174 cmd = [suite] + args | 186 cmd = [suite] + args |
175 cmd += suites_options.get(suite, []) | 187 cmd += suites_options.get(suite, []) |
176 if suite == 'content_browsertests' or suite == 'components_browsertests': | 188 if suite == 'content_browsertests' or suite == 'components_browsertests': |
177 cmd.append('--num_retries=1') | 189 cmd.append('--num_retries=1') |
178 _RunTest(options, cmd, suite) | 190 _RunTest(options, cmd, suite) |
179 | 191 |
180 | 192 |
| 193 def RunJunitSuite(suite): |
| 194 bb_annotations.PrintNamedStep(suite) |
| 195 RunCmd(['build/android/test_runner.py', 'junit', '-s', suite]) |
| 196 |
| 197 |
181 def RunChromeDriverTests(options): | 198 def RunChromeDriverTests(options): |
182 """Run all the steps for running chromedriver tests.""" | 199 """Run all the steps for running chromedriver tests.""" |
183 bb_annotations.PrintNamedStep('chromedriver_annotation') | 200 bb_annotations.PrintNamedStep('chromedriver_annotation') |
184 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', | 201 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', |
185 '--android-packages=%s,%s,%s,%s' % | 202 '--android-packages=%s,%s,%s,%s' % |
186 ('chrome_shell', | 203 ('chrome_shell', |
187 'chrome_stable', | 204 'chrome_stable', |
188 'chrome_beta', | 205 'chrome_beta', |
189 'chromedriver_webview_shell'), | 206 'chromedriver_webview_shell'), |
190 '--revision=%s' % _GetRevision(options), | 207 '--revision=%s' % _GetRevision(options), |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 '--os-type', | 547 '--os-type', |
531 'android', | 548 'android', |
532 '--test-machine-name', | 549 '--test-machine-name', |
533 EscapeBuilderName(builder_name)]) | 550 EscapeBuilderName(builder_name)]) |
534 | 551 |
535 bb_annotations.PrintNamedStep('webgl_conformance_tests') | 552 bb_annotations.PrintNamedStep('webgl_conformance_tests') |
536 RunCmd(['content/test/gpu/run_gpu_test.py', | 553 RunCmd(['content/test/gpu/run_gpu_test.py', |
537 '--browser=android-content-shell', 'webgl_conformance', | 554 '--browser=android-content-shell', 'webgl_conformance', |
538 '--webgl-conformance-version=1.0.1']) | 555 '--webgl-conformance-version=1.0.1']) |
539 | 556 |
| 557 bb_annotations.PrintNamedStep('android_webview_webgl_conformance_tests') |
| 558 RunCmd(['content/test/gpu/run_gpu_test.py', |
| 559 '--browser=android-webview-shell', 'webgl_conformance', |
| 560 '--webgl-conformance-version=1.0.1']) |
| 561 |
540 bb_annotations.PrintNamedStep('gpu_rasterization_tests') | 562 bb_annotations.PrintNamedStep('gpu_rasterization_tests') |
541 RunCmd(['content/test/gpu/run_gpu_test.py', | 563 RunCmd(['content/test/gpu/run_gpu_test.py', |
542 'gpu_rasterization', | 564 'gpu_rasterization', |
543 '--browser', | 565 '--browser', |
544 'android-content-shell', | 566 'android-content-shell', |
545 '--build-revision', | 567 '--build-revision', |
546 str(revision), | 568 str(revision), |
547 '--test-machine-name', | 569 '--test-machine-name', |
548 EscapeBuilderName(builder_name)]) | 570 EscapeBuilderName(builder_name)]) |
549 | 571 |
550 | 572 |
551 def RunPythonUnitTests(_options): | 573 def RunPythonUnitTests(_options): |
552 for suite in constants.PYTHON_UNIT_TEST_SUITES: | 574 for suite in constants.PYTHON_UNIT_TEST_SUITES: |
553 bb_annotations.PrintNamedStep(suite) | 575 bb_annotations.PrintNamedStep(suite) |
554 RunCmd(['build/android/test_runner.py', 'python', '-s', suite]) | 576 RunCmd(['build/android/test_runner.py', 'python', '-s', suite]) |
555 | 577 |
556 | 578 |
557 def GetTestStepCmds(): | 579 def GetTestStepCmds(): |
558 return [ | 580 return [ |
| 581 ('base_junit_tests', |
| 582 lambda _options: RunJunitSuite('base_junit_tests')), |
559 ('chromedriver', RunChromeDriverTests), | 583 ('chromedriver', RunChromeDriverTests), |
560 ('chrome_proxy', RunChromeProxyTests), | 584 ('chrome_proxy', RunChromeProxyTests), |
561 ('components_browsertests', | 585 ('components_browsertests', |
562 lambda options: RunTestSuites(options, ['components_browsertests'])), | 586 lambda options: RunTestSuites(options, ['components_browsertests'])), |
| 587 ('gfx_unittests', |
| 588 lambda options: RunTestSuites(options, ['gfx_unittests'])), |
| 589 ('gl_unittests', |
| 590 lambda options: RunTestSuites(options, ['gl_unittests'])), |
563 ('gpu', RunGPUTests), | 591 ('gpu', RunGPUTests), |
564 ('python_unittests', RunPythonUnitTests), | 592 ('python_unittests', RunPythonUnitTests), |
565 ('telemetry_unittests', RunTelemetryUnitTests), | 593 ('telemetry_unittests', RunTelemetryUnitTests), |
566 ('telemetry_perf_unittests', RunTelemetryPerfUnitTests), | 594 ('telemetry_perf_unittests', RunTelemetryPerfUnitTests), |
567 ('ui', RunInstrumentationTests), | 595 ('ui', RunInstrumentationTests), |
568 ('unit', RunUnitTests), | 596 ('unit', RunUnitTests), |
569 ('webkit', RunWebkitTests), | 597 ('webkit', RunWebkitTests), |
570 ('webkit_layout', RunWebkitLayoutTests), | 598 ('webkit_layout', RunWebkitLayoutTests), |
571 ] | 599 ] |
572 | 600 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 788 |
761 if options.coverage_bucket: | 789 if options.coverage_bucket: |
762 setattr(options, 'coverage_dir', | 790 setattr(options, 'coverage_dir', |
763 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 791 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
764 | 792 |
765 MainTestWrapper(options) | 793 MainTestWrapper(options) |
766 | 794 |
767 | 795 |
768 if __name__ == '__main__': | 796 if __name__ == '__main__': |
769 sys.exit(main(sys.argv)) | 797 sys.exit(main(sys.argv)) |
OLD | NEW |