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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 '--num_retries', '--num-retries', | 56 '--num_retries', '--num-retries', |
57 dest='num_retries', type=int, default=2, | 57 dest='num_retries', type=int, default=2, |
58 help='Number of retries for a test before ' | 58 help='Number of retries for a test before ' |
59 'giving up (default: %(default)s).') | 59 'giving up (default: %(default)s).') |
60 parser.add_argument( | 60 parser.add_argument( |
61 '--test-launcher-summary-output', | 61 '--test-launcher-summary-output', |
62 '--json-results-file', | 62 '--json-results-file', |
63 dest='json_results_file', type=os.path.realpath, | 63 dest='json_results_file', type=os.path.realpath, |
64 help='If set, will dump results in JSON form ' | 64 help='If set, will dump results in JSON form ' |
65 'to specified file.') | 65 'to specified file.') |
| 66 parser.add_argument( |
| 67 '--test-launcher-shard-index', |
| 68 type=int, default=os.environ.get('GTEST_SHARD_INDEX', 0), |
| 69 help='Index of the external shard to run.') |
| 70 parser.add_argument( |
| 71 '--test-launcher-total-shards', |
| 72 type=int, default=os.environ.get('GTEST_TOTAL_SHARDS', 1), |
| 73 help='Total number of external shards.') |
66 | 74 |
67 return parser | 75 return parser |
68 | 76 |
69 | 77 |
70 def AddTracingOptions(parser): | 78 def AddTracingOptions(parser): |
71 # TODO(shenghuazhang): Move this into AddCommonOptions once it's supported | 79 # TODO(shenghuazhang): Move this into AddCommonOptions once it's supported |
72 # for all test types. | 80 # for all test types. |
73 parser.add_argument( | 81 parser.add_argument( |
74 '--trace-output', | 82 '--trace-output', |
75 metavar='FILENAME', type=os.path.realpath, | 83 metavar='FILENAME', type=os.path.realpath, |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 if e.is_infra_error: | 877 if e.is_infra_error: |
870 return constants.INFRA_EXIT_CODE | 878 return constants.INFRA_EXIT_CODE |
871 return constants.ERROR_EXIT_CODE | 879 return constants.ERROR_EXIT_CODE |
872 except: # pylint: disable=W0702 | 880 except: # pylint: disable=W0702 |
873 logging.exception('Unrecognized error occurred.') | 881 logging.exception('Unrecognized error occurred.') |
874 return constants.ERROR_EXIT_CODE | 882 return constants.ERROR_EXIT_CODE |
875 | 883 |
876 | 884 |
877 if __name__ == '__main__': | 885 if __name__ == '__main__': |
878 sys.exit(main()) | 886 sys.exit(main()) |
OLD | NEW |