OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Runs all types of tests from one unified interface.""" | 7 """Runs all types of tests from one unified interface.""" |
8 | 8 |
9 import argparse | 9 import argparse |
10 import collections | 10 import collections |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 def _RunJUnitTests(args): | 768 def _RunJUnitTests(args): |
769 """Subcommand of RunTestsCommand which runs junit tests.""" | 769 """Subcommand of RunTestsCommand which runs junit tests.""" |
770 runner_factory, tests = junit_setup.Setup(args) | 770 runner_factory, tests = junit_setup.Setup(args) |
771 results, exit_code = junit_dispatcher.RunTests(tests, runner_factory) | 771 results, exit_code = junit_dispatcher.RunTests(tests, runner_factory) |
772 | 772 |
773 report_results.LogFull( | 773 report_results.LogFull( |
774 results=results, | 774 results=results, |
775 test_type='JUnit', | 775 test_type='JUnit', |
776 test_package=args.test_suite) | 776 test_package=args.test_suite) |
777 | 777 |
| 778 if args.json_results_file: |
| 779 json_results.GenerateJsonResultsFile(results, args.json_results_file) |
| 780 |
778 return exit_code | 781 return exit_code |
779 | 782 |
780 | 783 |
781 def _RunMonkeyTests(args, devices): | 784 def _RunMonkeyTests(args, devices): |
782 """Subcommand of RunTestsCommands which runs monkey tests.""" | 785 """Subcommand of RunTestsCommands which runs monkey tests.""" |
783 monkey_options = ProcessMonkeyTestOptions(args) | 786 monkey_options = ProcessMonkeyTestOptions(args) |
784 | 787 |
785 runner_factory, tests = monkey_setup.Setup(monkey_options) | 788 runner_factory, tests = monkey_setup.Setup(monkey_options) |
786 | 789 |
787 results, exit_code = test_dispatcher.RunTests( | 790 results, exit_code = test_dispatcher.RunTests( |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 return constants.INFRA_EXIT_CODE | 1032 return constants.INFRA_EXIT_CODE |
1030 else: | 1033 else: |
1031 return constants.ERROR_EXIT_CODE | 1034 return constants.ERROR_EXIT_CODE |
1032 except: # pylint: disable=W0702 | 1035 except: # pylint: disable=W0702 |
1033 logging.exception('Unrecognized error occurred.') | 1036 logging.exception('Unrecognized error occurred.') |
1034 return constants.ERROR_EXIT_CODE | 1037 return constants.ERROR_EXIT_CODE |
1035 | 1038 |
1036 | 1039 |
1037 if __name__ == '__main__': | 1040 if __name__ == '__main__': |
1038 sys.exit(main()) | 1041 sys.exit(main()) |
OLD | NEW |