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 os | 10 import os |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 def MainTestWrapper(options): | 636 def MainTestWrapper(options): |
637 try: | 637 try: |
638 # Spawn logcat monitor | 638 # Spawn logcat monitor |
639 SpawnLogcatMonitor() | 639 SpawnLogcatMonitor() |
640 | 640 |
641 # Run all device setup steps | 641 # Run all device setup steps |
642 for _, cmd in GetDeviceSetupStepCmds(): | 642 for _, cmd in GetDeviceSetupStepCmds(): |
643 cmd(options) | 643 cmd(options) |
644 | 644 |
645 if options.install: | 645 if options.install: |
646 test_obj = INSTRUMENTATION_TESTS[options.install] | 646 for i in options.install: |
647 InstallApk(options, test_obj, print_step=True) | 647 test_obj = INSTRUMENTATION_TESTS[i] |
| 648 InstallApk(options, test_obj, print_step=True) |
648 | 649 |
649 if options.test_filter: | 650 if options.test_filter: |
650 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) | 651 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
651 | 652 |
652 if options.coverage_bucket: | 653 if options.coverage_bucket: |
653 coverage_html = GenerateJavaCoverageReport(options) | 654 coverage_html = GenerateJavaCoverageReport(options) |
654 UploadHTML(options, '%s/java' % options.coverage_bucket, coverage_html, | 655 UploadHTML(options, '%s/java' % options.coverage_bucket, coverage_html, |
655 'Coverage Report') | 656 'Coverage Report') |
656 shutil.rmtree(coverage_html, ignore_errors=True) | 657 shutil.rmtree(coverage_html, ignore_errors=True) |
657 | 658 |
(...skipping 18 matching lines...) Expand all Loading... |
676 parser = bb_utils.GetParser() | 677 parser = bb_utils.GetParser() |
677 parser.add_option('--experimental', action='store_true', | 678 parser.add_option('--experimental', action='store_true', |
678 help='Run experiemental tests') | 679 help='Run experiemental tests') |
679 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], | 680 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], |
680 action='append', | 681 action='append', |
681 help=('Run a test suite. Test suites: "%s"' % | 682 help=('Run a test suite. Test suites: "%s"' % |
682 '", "'.join(VALID_TESTS))) | 683 '", "'.join(VALID_TESTS))) |
683 parser.add_option('--gtest-filter', | 684 parser.add_option('--gtest-filter', |
684 help='Filter for running a subset of tests of a gtest test') | 685 help='Filter for running a subset of tests of a gtest test') |
685 parser.add_option('--asan', action='store_true', help='Run tests with asan.') | 686 parser.add_option('--asan', action='store_true', help='Run tests with asan.') |
686 parser.add_option('--install', metavar='<apk name>', | 687 parser.add_option('--install', metavar='<apk name>', action="append", |
687 help='Install an apk by name') | 688 help='Install an apk by name') |
688 parser.add_option('--no-reboot', action='store_true', | 689 parser.add_option('--no-reboot', action='store_true', |
689 help='Do not reboot devices during provisioning.') | 690 help='Do not reboot devices during provisioning.') |
690 parser.add_option('--coverage-bucket', | 691 parser.add_option('--coverage-bucket', |
691 help=('Bucket name to store coverage results. Coverage is ' | 692 help=('Bucket name to store coverage results. Coverage is ' |
692 'only run if this is set.')) | 693 'only run if this is set.')) |
693 parser.add_option('--restart-usb', action='store_true', | 694 parser.add_option('--restart-usb', action='store_true', |
694 help='Restart usb ports before device status check.') | 695 help='Restart usb ports before device status check.') |
695 parser.add_option( | 696 parser.add_option( |
696 '--flakiness-server', | 697 '--flakiness-server', |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 742 |
742 if options.coverage_bucket: | 743 if options.coverage_bucket: |
743 setattr(options, 'coverage_dir', | 744 setattr(options, 'coverage_dir', |
744 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 745 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
745 | 746 |
746 MainTestWrapper(options) | 747 MainTestWrapper(options) |
747 | 748 |
748 | 749 |
749 if __name__ == '__main__': | 750 if __name__ == '__main__': |
750 sys.exit(main(sys.argv)) | 751 sys.exit(main(sys.argv)) |
OLD | NEW |