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 hashlib | 8 import hashlib |
9 import json | 9 import json |
10 import multiprocessing | 10 import multiprocessing |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 def ProvisionDevices(options): | 396 def ProvisionDevices(options): |
397 bb_annotations.PrintNamedStep('provision_devices') | 397 bb_annotations.PrintNamedStep('provision_devices') |
398 | 398 |
399 if not bb_utils.TESTING: | 399 if not bb_utils.TESTING: |
400 # Restart adb to work around bugs, sleep to wait for usb discovery. | 400 # Restart adb to work around bugs, sleep to wait for usb discovery. |
401 adb = android_commands.AndroidCommands() | 401 adb = android_commands.AndroidCommands() |
402 adb.RestartAdbServer() | 402 adb.RestartAdbServer() |
403 RunCmd(['sleep', '1']) | 403 RunCmd(['sleep', '1']) |
404 | 404 |
405 if options.reboot: | 405 if not options.no_reboot: |
406 RebootDevices() | 406 RebootDevices() |
407 provision_cmd = ['build/android/provision_devices.py', '-t', options.target] | 407 provision_cmd = ['build/android/provision_devices.py', '-t', options.target] |
408 if options.auto_reconnect: | 408 if options.auto_reconnect: |
409 provision_cmd.append('--auto-reconnect') | 409 provision_cmd.append('--auto-reconnect') |
410 RunCmd(provision_cmd) | 410 RunCmd(provision_cmd) |
411 | 411 |
412 | 412 |
413 def DeviceStatusCheck(options): | 413 def DeviceStatusCheck(options): |
414 bb_annotations.PrintNamedStep('device_status_check') | 414 bb_annotations.PrintNamedStep('device_status_check') |
415 cmd = ['build/android/buildbot/bb_device_status_check.py'] | 415 cmd = ['build/android/buildbot/bb_device_status_check.py'] |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 help='Run experiemental tests') | 570 help='Run experiemental tests') |
571 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], | 571 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], |
572 action='append', | 572 action='append', |
573 help=('Run a test suite. Test suites: "%s"' % | 573 help=('Run a test suite. Test suites: "%s"' % |
574 '", "'.join(VALID_TESTS))) | 574 '", "'.join(VALID_TESTS))) |
575 parser.add_option('--gtest-filter', | 575 parser.add_option('--gtest-filter', |
576 help='Filter for running a subset of tests of a gtest test') | 576 help='Filter for running a subset of tests of a gtest test') |
577 parser.add_option('--asan', action='store_true', help='Run tests with asan.') | 577 parser.add_option('--asan', action='store_true', help='Run tests with asan.') |
578 parser.add_option('--install', metavar='<apk name>', | 578 parser.add_option('--install', metavar='<apk name>', |
579 help='Install an apk by name') | 579 help='Install an apk by name') |
580 parser.add_option('--reboot', action='store_true', | 580 parser.add_option('--no-reboot', action='store_true', |
581 help='Reboot devices before running tests') | 581 help='Do not reboot devices during provisioning.') |
582 parser.add_option('--coverage-bucket', | 582 parser.add_option('--coverage-bucket', |
583 help=('Bucket name to store coverage results. Coverage is ' | 583 help=('Bucket name to store coverage results. Coverage is ' |
584 'only run if this is set.')) | 584 'only run if this is set.')) |
585 parser.add_option('--restart-usb', action='store_true', | 585 parser.add_option('--restart-usb', action='store_true', |
586 help='Restart usb ports before device status check.') | 586 help='Restart usb ports before device status check.') |
587 parser.add_option( | 587 parser.add_option( |
588 '--flakiness-server', | 588 '--flakiness-server', |
589 help=('The flakiness dashboard server to which the results should be ' | 589 help=('The flakiness dashboard server to which the results should be ' |
590 'uploaded.')) | 590 'uploaded.')) |
591 parser.add_option( | 591 parser.add_option( |
(...skipping 20 matching lines...) Expand all Loading... |
612 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 612 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
613 if options.coverage_bucket: | 613 if options.coverage_bucket: |
614 setattr(options, 'coverage_dir', | 614 setattr(options, 'coverage_dir', |
615 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 615 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
616 | 616 |
617 MainTestWrapper(options) | 617 MainTestWrapper(options) |
618 | 618 |
619 | 619 |
620 if __name__ == '__main__': | 620 if __name__ == '__main__': |
621 sys.exit(main(sys.argv)) | 621 sys.exit(main(sys.argv)) |
OLD | NEW |