| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 'to run on.')) | 134 'to run on.')) |
| 135 | 135 |
| 136 | 136 |
| 137 def AddGTestOptions(parser): | 137 def AddGTestOptions(parser): |
| 138 """Adds gtest options to |parser|.""" | 138 """Adds gtest options to |parser|.""" |
| 139 | 139 |
| 140 gtest_suites = list(gtest_config.STABLE_TEST_SUITES | 140 gtest_suites = list(gtest_config.STABLE_TEST_SUITES |
| 141 + gtest_config.EXPERIMENTAL_TEST_SUITES) | 141 + gtest_config.EXPERIMENTAL_TEST_SUITES) |
| 142 | 142 |
| 143 group = parser.add_argument_group('GTest Options') | 143 group = parser.add_argument_group('GTest Options') |
| 144 group.add_argument('-s', '--suite', dest='suite_name', choices=gtest_suites, | 144 group.add_argument('-s', '--suite', dest='suite_name', |
| 145 nargs='+', metavar='SUITE_NAME', required=True, | 145 nargs='+', metavar='SUITE_NAME', required=True, |
| 146 help=('Executable name of the test suite to run.')) | 146 help=('Executable name of the test suite to run. ' |
| 147 'Available suites include (but are not limited to): ' |
| 148 '%s' % ', '.join('"%s"' % s for s in gtest_suites))) |
| 147 group.add_argument('-f', '--gtest_filter', '--gtest-filter', | 149 group.add_argument('-f', '--gtest_filter', '--gtest-filter', |
| 148 dest='test_filter', | 150 dest='test_filter', |
| 149 help='googletest-style filter string.') | 151 help='googletest-style filter string.') |
| 150 group.add_argument('--gtest_also_run_disabled_tests', | 152 group.add_argument('--gtest_also_run_disabled_tests', |
| 151 '--gtest-also-run-disabled-tests', | 153 '--gtest-also-run-disabled-tests', |
| 152 dest='run_disabled', action='store_true', | 154 dest='run_disabled', action='store_true', |
| 153 help='Also run disabled tests if applicable.') | 155 help='Also run disabled tests if applicable.') |
| 154 group.add_argument('-a', '--test-arguments', dest='test_arguments', | 156 group.add_argument('-a', '--test-arguments', dest='test_arguments', |
| 155 default='', | 157 default='', |
| 156 help='Additional arguments to pass to the test.') | 158 help='Additional arguments to pass to the test.') |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 command_parsers = parser.add_subparsers(title='test types', | 917 command_parsers = parser.add_subparsers(title='test types', |
| 916 dest='command') | 918 dest='command') |
| 917 | 919 |
| 918 for test_type, config in sorted(VALID_COMMANDS.iteritems(), | 920 for test_type, config in sorted(VALID_COMMANDS.iteritems(), |
| 919 key=lambda x: x[0]): | 921 key=lambda x: x[0]): |
| 920 subparser = command_parsers.add_parser( | 922 subparser = command_parsers.add_parser( |
| 921 test_type, usage='%(prog)s [options]', help=config.help_txt) | 923 test_type, usage='%(prog)s [options]', help=config.help_txt) |
| 922 config.add_options_func(subparser) | 924 config.add_options_func(subparser) |
| 923 | 925 |
| 924 args = parser.parse_args() | 926 args = parser.parse_args() |
| 925 RunTestsCommand(args, parser) | 927 return RunTestsCommand(args, parser) |
| 926 | |
| 927 return 0 | |
| 928 | 928 |
| 929 | 929 |
| 930 if __name__ == '__main__': | 930 if __name__ == '__main__': |
| 931 sys.exit(main()) | 931 sys.exit(main()) |
| OLD | NEW |