Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: build/android/test_runner.py

Issue 1062403004: Add support for json-results-file option for Junit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698