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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if print_step: | 137 if print_step: |
138 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) | 138 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) |
139 args = ['--apk', test.apk, '--apk_package', test.apk_package] | 139 args = ['--apk', test.apk, '--apk_package', test.apk_package] |
140 if options.target == 'Release': | 140 if options.target == 'Release': |
141 args.append('--release') | 141 args.append('--release') |
142 | 142 |
143 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) | 143 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
144 | 144 |
145 | 145 |
146 def RunInstrumentationSuite(options, test, flunk_on_failure=True, | 146 def RunInstrumentationSuite(options, test, flunk_on_failure=True, |
147 python_only=False): | 147 python_only=False, official_build=False): |
148 """Manages an invocation of test_runner.py for instrumentation tests. | 148 """Manages an invocation of test_runner.py for instrumentation tests. |
149 | 149 |
150 Args: | 150 Args: |
151 options: options object | 151 options: options object |
152 test: An I_TEST namedtuple | 152 test: An I_TEST namedtuple |
153 flunk_on_failure: Flunk the step if tests fail. | 153 flunk_on_failure: Flunk the step if tests fail. |
154 Python: Run only host driven Python tests. | 154 Python: Run only host driven Python tests. |
| 155 official_build: Run official-build tests. |
155 """ | 156 """ |
156 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) | 157 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) |
157 | 158 |
158 InstallApk(options, test) | 159 InstallApk(options, test) |
159 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, | 160 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, |
160 '--verbose'] | 161 '--verbose'] |
161 if options.target == 'Release': | 162 if options.target == 'Release': |
162 args.append('--release') | 163 args.append('--release') |
163 if options.asan: | 164 if options.asan: |
164 args.append('--tool=asan') | 165 args.append('--tool=asan') |
165 if options.flakiness_server: | 166 if options.flakiness_server: |
166 args.append('--flakiness-dashboard-server=%s' % | 167 args.append('--flakiness-dashboard-server=%s' % |
167 options.flakiness_server) | 168 options.flakiness_server) |
168 if test.host_driven_root: | 169 if test.host_driven_root: |
169 args.append('--host-driven-root=%s' % test.host_driven_root) | 170 args.append('--host-driven-root=%s' % test.host_driven_root) |
170 if test.annotation: | 171 if test.annotation: |
171 args.extend(['-A', test.annotation]) | 172 args.extend(['-A', test.annotation]) |
172 if test.exclude_annotation: | 173 if test.exclude_annotation: |
173 args.extend(['-E', test.exclude_annotation]) | 174 args.extend(['-E', test.exclude_annotation]) |
174 if test.extra_flags: | 175 if test.extra_flags: |
175 args.extend(test.extra_flags) | 176 args.extend(test.extra_flags) |
176 if python_only: | 177 if python_only: |
177 args.append('-p') | 178 args.append('-p') |
| 179 if official_build: |
| 180 # The option needs to be assigned 'True' as it does not have an action |
| 181 # associated with it. |
| 182 args.append('--official-build') |
178 | 183 |
179 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, | 184 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, |
180 flunk_on_failure=flunk_on_failure) | 185 flunk_on_failure=flunk_on_failure) |
181 | 186 |
182 | 187 |
183 def RunWebkitLint(target): | 188 def RunWebkitLint(target): |
184 """Lint WebKit's TestExpectation files.""" | 189 """Lint WebKit's TestExpectation files.""" |
185 bb_annotations.PrintNamedStep('webkit_lint') | 190 bb_annotations.PrintNamedStep('webkit_lint') |
186 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', | 191 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py', |
187 '--lint-test-files', | 192 '--lint-test-files', |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 if unknown_tests: | 384 if unknown_tests: |
380 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 385 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
381 | 386 |
382 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 387 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
383 | 388 |
384 MainTestWrapper(options) | 389 MainTestWrapper(options) |
385 | 390 |
386 | 391 |
387 if __name__ == '__main__': | 392 if __name__ == '__main__': |
388 sys.exit(main(sys.argv)) | 393 sys.exit(main(sys.argv)) |
OLD | NEW |