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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 | 652 |
653 finally: | 653 finally: |
654 # Run all post test steps | 654 # Run all post test steps |
655 LogcatDump(options) | 655 LogcatDump(options) |
656 if not options.disable_stack_tool: | 656 if not options.disable_stack_tool: |
657 RunStackToolSteps(options) | 657 RunStackToolSteps(options) |
658 GenerateTestReport(options) | 658 GenerateTestReport(options) |
659 # KillHostHeartbeat() has logic to check if heartbeat process is running, | 659 # KillHostHeartbeat() has logic to check if heartbeat process is running, |
660 # and kills only if it finds the process is running on the host. | 660 # and kills only if it finds the process is running on the host. |
661 provision_devices.KillHostHeartbeat() | 661 provision_devices.KillHostHeartbeat() |
| 662 if options.cleanup: |
| 663 shutil.rmtree(os.path.join(CHROME_OUT_DIR, options.target), |
| 664 ignore_errors=True) |
662 | 665 |
663 | 666 |
664 def GetDeviceStepsOptParser(): | 667 def GetDeviceStepsOptParser(): |
665 parser = bb_utils.GetParser() | 668 parser = bb_utils.GetParser() |
666 parser.add_option('--experimental', action='store_true', | 669 parser.add_option('--experimental', action='store_true', |
667 help='Run experiemental tests') | 670 help='Run experiemental tests') |
668 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], | 671 parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], |
669 action='append', | 672 action='append', |
670 help=('Run a test suite. Test suites: "%s"' % | 673 help=('Run a test suite. Test suites: "%s"' % |
671 '", "'.join(VALID_TESTS))) | 674 '", "'.join(VALID_TESTS))) |
(...skipping 25 matching lines...) Expand all Loading... |
697 # which builds are produced. Therefore we should look for relevent output | 700 # which builds are produced. Therefore we should look for relevent output |
698 # file under this directory.(/b/build/slave/<slave_name>/build/bisect/src/out) | 701 # file under this directory.(/b/build/slave/<slave_name>/build/bisect/src/out) |
699 parser.add_option( | 702 parser.add_option( |
700 '--chrome-output-dir', | 703 '--chrome-output-dir', |
701 help='Chrome output directory to be used while bisecting.') | 704 help='Chrome output directory to be used while bisecting.') |
702 | 705 |
703 parser.add_option('--disable-stack-tool', action='store_true', | 706 parser.add_option('--disable-stack-tool', action='store_true', |
704 help='Do not run stack tool.') | 707 help='Do not run stack tool.') |
705 parser.add_option('--asan-symbolize', action='store_true', | 708 parser.add_option('--asan-symbolize', action='store_true', |
706 help='Run stack tool for ASAN') | 709 help='Run stack tool for ASAN') |
| 710 parser.add_option('--cleanup', action='store_true', |
| 711 help='Delete out/<target> directory at the end of the run.') |
707 return parser | 712 return parser |
708 | 713 |
709 | 714 |
710 def main(argv): | 715 def main(argv): |
711 parser = GetDeviceStepsOptParser() | 716 parser = GetDeviceStepsOptParser() |
712 options, args = parser.parse_args(argv[1:]) | 717 options, args = parser.parse_args(argv[1:]) |
713 | 718 |
714 if args: | 719 if args: |
715 return sys.exit('Unused args %s' % args) | 720 return sys.exit('Unused args %s' % args) |
716 | 721 |
(...skipping 11 matching lines...) Expand all Loading... |
728 | 733 |
729 if options.coverage_bucket: | 734 if options.coverage_bucket: |
730 setattr(options, 'coverage_dir', | 735 setattr(options, 'coverage_dir', |
731 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 736 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
732 | 737 |
733 MainTestWrapper(options) | 738 MainTestWrapper(options) |
734 | 739 |
735 | 740 |
736 if __name__ == '__main__': | 741 if __name__ == '__main__': |
737 sys.exit(main(sys.argv)) | 742 sys.exit(main(sys.argv)) |
OLD | NEW |