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 multiprocessing | 8 import multiprocessing |
9 import os | 9 import os |
10 import shutil | 10 import shutil |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if result: | 93 if result: |
94 print '%s failed to startup.' % device | 94 print '%s failed to startup.' % device |
95 | 95 |
96 if any(results): | 96 if any(results): |
97 buildbot_report.PrintWarning() | 97 buildbot_report.PrintWarning() |
98 else: | 98 else: |
99 print 'Reboots complete.' | 99 print 'Reboots complete.' |
100 | 100 |
101 | 101 |
102 def RunTestSuites(options, suites): | 102 def RunTestSuites(options, suites): |
103 """Manages an invocation of run_tests.py. | 103 """Manages an invocation of test_runner.py for gtests. |
104 | 104 |
105 Args: | 105 Args: |
106 options: options object. | 106 options: options object. |
107 suites: List of suites to run. | 107 suites: List of suites to run. |
108 """ | 108 """ |
109 args = ['--verbose'] | 109 args = ['--verbose'] |
110 if options.target == 'Release': | 110 if options.target == 'Release': |
111 args.append('--release') | 111 args.append('--release') |
112 if options.asan: | 112 if options.asan: |
113 args.append('--tool=asan') | 113 args.append('--tool=asan') |
114 for suite in suites: | 114 for suite in suites: |
115 buildbot_report.PrintNamedStep(suite.name) | 115 buildbot_report.PrintNamedStep(suite.name) |
116 cmd = ['build/android/run_tests.py', '-s', suite.name] + args | 116 cmd = ['build/android/test_runner.py', 'gtest', '-s', suite.name] + args |
117 if suite.is_suite_exe: | 117 if suite.is_suite_exe: |
118 cmd.append('--exe') | 118 cmd.append('--exe') |
119 RunCmd(cmd) | 119 RunCmd(cmd) |
120 | 120 |
121 def RunBrowserTestSuite(options): | 121 def RunBrowserTestSuite(options): |
122 """Manages an invocation of run_browser_tests.py. | 122 """Manages an invocation of test_runner.py for content_browsertests. |
123 | 123 |
124 Args: | 124 Args: |
125 options: options object. | 125 options: options object. |
126 """ | 126 """ |
127 args = ['--verbose', '--num_retries=1'] | 127 args = ['--verbose', '--num_retries=1'] |
128 if options.target == 'Release': | 128 if options.target == 'Release': |
129 args.append('--release') | 129 args.append('--release') |
130 if options.asan: | 130 if options.asan: |
131 args.append('--tool=asan') | 131 args.append('--tool=asan') |
132 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) | 132 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) |
133 RunCmd(['build/android/run_browser_tests.py'] + args) | 133 RunCmd(['build/android/test_runner.py', 'content_browsertests'] + args) |
134 | 134 |
135 def RunChromeDriverTests(_): | 135 def RunChromeDriverTests(_): |
136 """Run all the steps for running chromedriver tests.""" | 136 """Run all the steps for running chromedriver tests.""" |
137 buildbot_report.PrintNamedStep('chromedriver_annotation') | 137 buildbot_report.PrintNamedStep('chromedriver_annotation') |
138 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', | 138 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', |
139 '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) | 139 '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) |
140 | 140 |
141 def InstallApk(options, test, print_step=False): | 141 def InstallApk(options, test, print_step=False): |
142 """Install an apk to all phones. | 142 """Install an apk to all phones. |
143 | 143 |
144 Args: | 144 Args: |
145 options: options object | 145 options: options object |
146 test: An I_TEST namedtuple | 146 test: An I_TEST namedtuple |
147 print_step: Print a buildbot step | 147 print_step: Print a buildbot step |
148 """ | 148 """ |
149 if print_step: | 149 if print_step: |
150 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) | 150 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) |
151 args = ['--apk', test.apk, '--apk_package', test.apk_package] | 151 args = ['--apk', test.apk, '--apk_package', test.apk_package] |
152 if options.target == 'Release': | 152 if options.target == 'Release': |
153 args.append('--release') | 153 args.append('--release') |
154 | 154 |
155 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) | 155 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
156 | 156 |
157 | 157 |
158 def RunInstrumentationSuite(options, test): | 158 def RunInstrumentationSuite(options, test): |
159 """Manages an invocation of run_instrumentaiton_tests.py. | 159 """Manages an invocation of test_runner.py for instrumentation tests. |
160 | 160 |
161 Args: | 161 Args: |
162 options: options object | 162 options: options object |
163 test: An I_TEST namedtuple | 163 test: An I_TEST namedtuple |
164 """ | 164 """ |
165 buildbot_report.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) | 165 buildbot_report.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) |
166 | 166 |
167 InstallApk(options, test) | 167 InstallApk(options, test) |
168 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, | 168 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, |
169 '--verbose', '-I'] | 169 '--verbose', '-I'] |
170 if options.target == 'Release': | 170 if options.target == 'Release': |
171 args.append('--release') | 171 args.append('--release') |
172 if options.asan: | 172 if options.asan: |
173 args.append('--tool=asan') | 173 args.append('--tool=asan') |
174 if options.upload_to_flakiness_server: | 174 if options.upload_to_flakiness_server: |
175 args.append('--flakiness-dashboard-server=%s' % | 175 args.append('--flakiness-dashboard-server=%s' % |
176 constants.UPSTREAM_FLAKINESS_SERVER) | 176 constants.UPSTREAM_FLAKINESS_SERVER) |
177 if test.host_driven_root: | 177 if test.host_driven_root: |
178 args.append('--python_test_root=%s' % test.host_driven_root) | 178 args.append('--python_test_root=%s' % test.host_driven_root) |
179 if test.annotation: | 179 if test.annotation: |
180 args.extend(['-A', test.annotation]) | 180 args.extend(['-A', test.annotation]) |
181 if test.exclude_annotation: | 181 if test.exclude_annotation: |
182 args.extend(['-E', test.exclude_annotation]) | 182 args.extend(['-E', test.exclude_annotation]) |
183 if test.extra_flags: | 183 if test.extra_flags: |
184 args.extend(test.extra_flags) | 184 args.extend(test.extra_flags) |
185 | 185 |
186 RunCmd(['build/android/run_instrumentation_tests.py'] + args) | 186 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args) |
187 | 187 |
188 | 188 |
189 def RunWebkitLint(target): | 189 def RunWebkitLint(target): |
190 """Lint WebKit's TestExpectation files.""" | 190 """Lint WebKit's TestExpectation files.""" |
191 buildbot_report.PrintNamedStep('webkit_lint') | 191 buildbot_report.PrintNamedStep('webkit_lint') |
192 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', | 192 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', |
193 '--lint-test-files', | 193 '--lint-test-files', |
194 '--chromium', | 194 '--chromium', |
195 '--target', target]) | 195 '--target', target]) |
196 | 196 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 if unknown_tests: | 376 if unknown_tests: |
377 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 377 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
378 | 378 |
379 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 379 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
380 | 380 |
381 MainTestWrapper(options) | 381 MainTestWrapper(options) |
382 | 382 |
383 | 383 |
384 if __name__ == '__main__': | 384 if __name__ == '__main__': |
385 sys.exit(main(sys.argv)) | 385 sys.exit(main(sys.argv)) |
OLD | NEW |