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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 """ | 165 """ |
166 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) | 166 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) |
167 | 167 |
168 InstallApk(options, test) | 168 InstallApk(options, test) |
169 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, | 169 args = ['--test-apk', test.test_apk, '--test_data', test.test_data, |
170 '--verbose', '-I'] | 170 '--verbose', '-I'] |
171 if options.target == 'Release': | 171 if options.target == 'Release': |
172 args.append('--release') | 172 args.append('--release') |
173 if options.asan: | 173 if options.asan: |
174 args.append('--tool=asan') | 174 args.append('--tool=asan') |
175 if options.upload_to_flakiness_server: | 175 if options.flakiness_server: |
176 args.append('--flakiness-dashboard-server=%s' % | 176 args.append('--flakiness-dashboard-server=%s' % |
177 constants.UPSTREAM_FLAKINESS_SERVER) | 177 options.flakiness_server) |
178 if test.host_driven_root: | 178 if test.host_driven_root: |
179 args.append('--python_test_root=%s' % test.host_driven_root) | 179 args.append('--python_test_root=%s' % test.host_driven_root) |
180 if test.annotation: | 180 if test.annotation: |
181 args.extend(['-A', test.annotation]) | 181 args.extend(['-A', test.annotation]) |
182 if test.exclude_annotation: | 182 if test.exclude_annotation: |
183 args.extend(['-E', test.exclude_annotation]) | 183 args.extend(['-E', test.exclude_annotation]) |
184 if test.extra_flags: | 184 if test.extra_flags: |
185 args.extend(test.extra_flags) | 185 args.extend(test.extra_flags) |
186 | 186 |
187 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, | 187 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 help='Run experiemental tests') | 352 help='Run experiemental tests') |
353 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], | 353 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], |
354 action='append', | 354 action='append', |
355 help=('Run a test suite. Test suites: "%s"' % | 355 help=('Run a test suite. Test suites: "%s"' % |
356 '", "'.join(VALID_TESTS))) | 356 '", "'.join(VALID_TESTS))) |
357 parser.add_option('--asan', action='store_true', help='Run tests with asan.') | 357 parser.add_option('--asan', action='store_true', help='Run tests with asan.') |
358 parser.add_option('--install', metavar='<apk name>', | 358 parser.add_option('--install', metavar='<apk name>', |
359 help='Install an apk by name') | 359 help='Install an apk by name') |
360 parser.add_option('--reboot', action='store_true', | 360 parser.add_option('--reboot', action='store_true', |
361 help='Reboot devices before running tests') | 361 help='Reboot devices before running tests') |
362 parser.add_option('--upload-to-flakiness-server', action='store_true', | 362 parser.add_option('--flakiness-server', |
363 help='Upload the results to the flakiness dashboard.') | 363 help='Upload the results to the flakiness dashboard.') |
frankf
2013/07/22 21:00:58
Update the help to something like "Address of the
Siva Chandra
2013/07/22 21:05:06
I uploaded patch set 2 with this fixed while you w
| |
364 parser.add_option( | 364 parser.add_option( |
365 '--auto-reconnect', action='store_true', | 365 '--auto-reconnect', action='store_true', |
366 help='Push script to device which restarts adbd on disconnections.') | 366 help='Push script to device which restarts adbd on disconnections.') |
367 parser.add_option( | 367 parser.add_option( |
368 '--logcat-dump-output', | 368 '--logcat-dump-output', |
369 help='The logcat dump output will be "tee"-ed into this file') | 369 help='The logcat dump output will be "tee"-ed into this file') |
370 | 370 |
371 return parser | 371 return parser |
372 | 372 |
373 | 373 |
374 def main(argv): | 374 def main(argv): |
375 parser = GetDeviceStepsOptParser() | 375 parser = GetDeviceStepsOptParser() |
376 options, args = parser.parse_args(argv[1:]) | 376 options, args = parser.parse_args(argv[1:]) |
377 | 377 |
378 if args: | 378 if args: |
379 return sys.exit('Unused args %s' % args) | 379 return sys.exit('Unused args %s' % args) |
380 | 380 |
381 unknown_tests = set(options.test_filter) - VALID_TESTS | 381 unknown_tests = set(options.test_filter) - VALID_TESTS |
382 if unknown_tests: | 382 if unknown_tests: |
383 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 383 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
384 | 384 |
385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
386 | 386 |
387 MainTestWrapper(options) | 387 MainTestWrapper(options) |
388 provision_devices.KillHostHeartbeat() | 388 provision_devices.KillHostHeartbeat() |
389 | 389 |
390 | 390 |
391 if __name__ == '__main__': | 391 if __name__ == '__main__': |
392 sys.exit(main(sys.argv)) | 392 sys.exit(main(sys.argv)) |
OLD | NEW |