| 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( |
| 363 help='Upload the results to the flakiness dashboard.') | 363 '--flakiness-server', |
| 364 help='The flakiness dashboard server to which the results should be ' |
| 365 'uploaded.') |
| 364 parser.add_option( | 366 parser.add_option( |
| 365 '--auto-reconnect', action='store_true', | 367 '--auto-reconnect', action='store_true', |
| 366 help='Push script to device which restarts adbd on disconnections.') | 368 help='Push script to device which restarts adbd on disconnections.') |
| 367 parser.add_option( | 369 parser.add_option( |
| 368 '--logcat-dump-output', | 370 '--logcat-dump-output', |
| 369 help='The logcat dump output will be "tee"-ed into this file') | 371 help='The logcat dump output will be "tee"-ed into this file') |
| 370 | 372 |
| 371 return parser | 373 return parser |
| 372 | 374 |
| 373 | 375 |
| 374 def main(argv): | 376 def main(argv): |
| 375 parser = GetDeviceStepsOptParser() | 377 parser = GetDeviceStepsOptParser() |
| 376 options, args = parser.parse_args(argv[1:]) | 378 options, args = parser.parse_args(argv[1:]) |
| 377 | 379 |
| 378 if args: | 380 if args: |
| 379 return sys.exit('Unused args %s' % args) | 381 return sys.exit('Unused args %s' % args) |
| 380 | 382 |
| 381 unknown_tests = set(options.test_filter) - VALID_TESTS | 383 unknown_tests = set(options.test_filter) - VALID_TESTS |
| 382 if unknown_tests: | 384 if unknown_tests: |
| 383 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 385 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
| 384 | 386 |
| 385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 387 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 386 | 388 |
| 387 MainTestWrapper(options) | 389 MainTestWrapper(options) |
| 388 provision_devices.KillHostHeartbeat() | 390 provision_devices.KillHostHeartbeat() |
| 389 | 391 |
| 390 | 392 |
| 391 if __name__ == '__main__': | 393 if __name__ == '__main__': |
| 392 sys.exit(main(sys.argv)) | 394 sys.exit(main(sys.argv)) |
| OLD | NEW |