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

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

Issue 1003463002: Add json output to Junit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and addressed nyquist's comment. 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
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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 if args.json_results_file: 762 if args.json_results_file:
763 json_results.GenerateJsonResultsFile(results, args.json_results_file) 763 json_results.GenerateJsonResultsFile(results, args.json_results_file)
764 764
765 return exit_code 765 return exit_code
766 766
767 767
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 _, exit_code = junit_dispatcher.RunTests(tests, runner_factory) 771 results, exit_code = junit_dispatcher.RunTests(tests, runner_factory)
772
773 report_results.LogFull(
774 results=results,
775 test_type='JUnit',
776 test_package=args.test_suite)
777
772 return exit_code 778 return exit_code
773 779
774 780
775 def _RunMonkeyTests(args, devices): 781 def _RunMonkeyTests(args, devices):
776 """Subcommand of RunTestsCommands which runs monkey tests.""" 782 """Subcommand of RunTestsCommands which runs monkey tests."""
777 monkey_options = ProcessMonkeyTestOptions(args) 783 monkey_options = ProcessMonkeyTestOptions(args)
778 784
779 runner_factory, tests = monkey_setup.Setup(monkey_options) 785 runner_factory, tests = monkey_setup.Setup(monkey_options)
780 786
781 results, exit_code = test_dispatcher.RunTests( 787 results, exit_code = test_dispatcher.RunTests(
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 return constants.INFRA_EXIT_CODE 1029 return constants.INFRA_EXIT_CODE
1024 else: 1030 else:
1025 return constants.ERROR_EXIT_CODE 1031 return constants.ERROR_EXIT_CODE
1026 except: # pylint: disable=W0702 1032 except: # pylint: disable=W0702
1027 logging.exception('Unrecognized error occurred.') 1033 logging.exception('Unrecognized error occurred.')
1028 return constants.ERROR_EXIT_CODE 1034 return constants.ERROR_EXIT_CODE
1029 1035
1030 1036
1031 if __name__ == '__main__': 1037 if __name__ == '__main__':
1032 sys.exit(main()) 1038 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698