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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 if print_step: | 150 if print_step: |
151 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) | 151 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) |
152 args = ['--apk', test.apk, '--apk_package', test.apk_package] | 152 args = ['--apk', test.apk, '--apk_package', test.apk_package] |
153 if options.target == 'Release': | 153 if options.target == 'Release': |
154 args.append('--release') | 154 args.append('--release') |
155 | 155 |
156 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) | 156 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
157 | 157 |
158 | 158 |
159 def RunInstrumentationSuite(options, test, flunk_on_failure=True, | 159 def RunInstrumentationSuite(options, test, flunk_on_failure=True, |
160 python_only=False): | 160 python_only=False, official_build=False): |
161 """Manages an invocation of test_runner.py for instrumentation tests. | 161 """Manages an invocation of test_runner.py for instrumentation tests. |
162 | 162 |
163 Args: | 163 Args: |
164 options: options object | 164 options: options object |
165 test: An I_TEST namedtuple | 165 test: An I_TEST namedtuple |
166 flunk_on_failure: Flunk the step if tests fail. | 166 flunk_on_failure: Flunk the step if tests fail. |
167 Python: Run only host driven Python tests. | 167 Python: Run only host driven Python tests. |
168 official_build: Run official-build tests. | |
168 """ | 169 """ |
169 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) | 170 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) |
170 | 171 |
171 InstallApk(options, test) | 172 InstallApk(options, test) |
172 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, | 173 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, |
173 '--verbose', '-I'] | 174 '--verbose', '-I'] |
174 if options.target == 'Release': | 175 if options.target == 'Release': |
175 args.append('--release') | 176 args.append('--release') |
176 if options.asan: | 177 if options.asan: |
177 args.append('--tool=asan') | 178 args.append('--tool=asan') |
178 if options.flakiness_server: | 179 if options.flakiness_server: |
179 args.append('--flakiness-dashboard-server=%s' % | 180 args.append('--flakiness-dashboard-server=%s' % |
180 options.flakiness_server) | 181 options.flakiness_server) |
181 if test.host_driven_root: | 182 if test.host_driven_root: |
182 args.append('--python_test_root=%s' % test.host_driven_root) | 183 args.append('--python_test_root=%s' % test.host_driven_root) |
183 if test.annotation: | 184 if test.annotation: |
184 args.extend(['-A', test.annotation]) | 185 args.extend(['-A', test.annotation]) |
185 if test.exclude_annotation: | 186 if test.exclude_annotation: |
186 args.extend(['-E', test.exclude_annotation]) | 187 args.extend(['-E', test.exclude_annotation]) |
187 if test.extra_flags: | 188 if test.extra_flags: |
188 args.extend(test.extra_flags) | 189 args.extend(test.extra_flags) |
189 if python_only: | 190 if python_only: |
190 args.append('-p') | 191 args.append('-p') |
192 if official_build: | |
193 # The option needs to be assigned 'True' as it does not have an action | |
194 # associated with it. | |
195 args.append('--official-build=True') | |
Isaac (away)
2013/08/20 02:45:03
Can we change it to action='store_true' in this CL
Siva Chandra
2013/08/20 18:53:04
It is already setup with that action. Hence made t
| |
191 | 196 |
192 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, | 197 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, |
193 flunk_on_failure=flunk_on_failure) | 198 flunk_on_failure=flunk_on_failure) |
194 | 199 |
195 | 200 |
196 def RunWebkitLint(target): | 201 def RunWebkitLint(target): |
197 """Lint WebKit's TestExpectation files.""" | 202 """Lint WebKit's TestExpectation files.""" |
198 bb_annotations.PrintNamedStep('webkit_lint') | 203 bb_annotations.PrintNamedStep('webkit_lint') |
199 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', | 204 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', |
200 '--lint-test-files', | 205 '--lint-test-files', |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 395 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
391 | 396 |
392 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 397 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
393 | 398 |
394 MainTestWrapper(options) | 399 MainTestWrapper(options) |
395 provision_devices.KillHostHeartbeat() | 400 provision_devices.KillHostHeartbeat() |
396 | 401 |
397 | 402 |
398 if __name__ == '__main__': | 403 if __name__ == '__main__': |
399 sys.exit(main(sys.argv)) | 404 sys.exit(main(sys.argv)) |
OLD | NEW |