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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 gtest_suites = list(gtest_config.STABLE_TEST_SUITES | 178 gtest_suites = list(gtest_config.STABLE_TEST_SUITES |
179 + gtest_config.EXPERIMENTAL_TEST_SUITES) | 179 + gtest_config.EXPERIMENTAL_TEST_SUITES) |
180 | 180 |
181 group = parser.add_argument_group('GTest Options') | 181 group = parser.add_argument_group('GTest Options') |
182 group.add_argument('-s', '--suite', dest='suite_name', | 182 group.add_argument('-s', '--suite', dest='suite_name', |
183 nargs='+', metavar='SUITE_NAME', required=True, | 183 nargs='+', metavar='SUITE_NAME', required=True, |
184 help=('Executable name of the test suite to run. ' | 184 help=('Executable name of the test suite to run. ' |
185 'Available suites include (but are not limited to): ' | 185 'Available suites include (but are not limited to): ' |
186 '%s' % ', '.join('"%s"' % s for s in gtest_suites))) | 186 '%s' % ', '.join('"%s"' % s for s in gtest_suites))) |
187 group.add_argument('-f', '--gtest_filter', '--gtest-filter', | |
188 dest='test_filter', | |
189 help='googletest-style filter string.') | |
190 group.add_argument('--gtest_also_run_disabled_tests', | 187 group.add_argument('--gtest_also_run_disabled_tests', |
191 '--gtest-also-run-disabled-tests', | 188 '--gtest-also-run-disabled-tests', |
192 dest='run_disabled', action='store_true', | 189 dest='run_disabled', action='store_true', |
193 help='Also run disabled tests if applicable.') | 190 help='Also run disabled tests if applicable.') |
194 group.add_argument('-a', '--test-arguments', dest='test_arguments', | 191 group.add_argument('-a', '--test-arguments', dest='test_arguments', |
195 default='', | 192 default='', |
196 help='Additional arguments to pass to the test.') | 193 help='Additional arguments to pass to the test.') |
197 group.add_argument('-t', dest='timeout', type=int, default=60, | 194 group.add_argument('-t', dest='timeout', type=int, default=60, |
198 help='Timeout to wait for each test ' | 195 help='Timeout to wait for each test ' |
199 '(default: %(default)s).') | 196 '(default: %(default)s).') |
200 group.add_argument('--isolate_file_path', | 197 group.add_argument('--isolate_file_path', |
201 '--isolate-file-path', | 198 '--isolate-file-path', |
202 dest='isolate_file_path', | 199 dest='isolate_file_path', |
203 help='.isolate file path to override the default ' | 200 help='.isolate file path to override the default ' |
204 'path') | 201 'path') |
| 202 |
| 203 filter_group = group.add_mutually_exclusive_group() |
| 204 filter_group.add_argument('-f', '--gtest_filter', '--gtest-filter', |
| 205 dest='test_filter', |
| 206 help='googletest-style filter string.') |
| 207 filter_group.add_argument('--gtest-filter-file', dest='test_filter_file', |
| 208 help='Path to file that contains googletest-style ' |
| 209 'filter strings. (Lines will be joined with ' |
| 210 '":" to create a single filter string.)') |
| 211 |
205 AddDeviceOptions(parser) | 212 AddDeviceOptions(parser) |
206 AddCommonOptions(parser) | 213 AddCommonOptions(parser) |
207 AddRemoteDeviceOptions(parser) | 214 AddRemoteDeviceOptions(parser) |
208 | 215 |
209 | 216 |
210 def AddLinkerTestOptions(parser): | 217 def AddLinkerTestOptions(parser): |
211 group = parser.add_argument_group('Linker Test Options') | 218 group = parser.add_argument_group('Linker Test Options') |
212 group.add_argument('-f', '--gtest-filter', dest='test_filter', | 219 group.add_argument('-f', '--gtest-filter', dest='test_filter', |
213 help='googletest-style filter string.') | 220 help='googletest-style filter string.') |
214 AddCommonOptions(parser) | 221 AddCommonOptions(parser) |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 subparser = command_parsers.add_parser( | 996 subparser = command_parsers.add_parser( |
990 test_type, usage='%(prog)s [options]', help=config.help_txt) | 997 test_type, usage='%(prog)s [options]', help=config.help_txt) |
991 config.add_options_func(subparser) | 998 config.add_options_func(subparser) |
992 | 999 |
993 args = parser.parse_args() | 1000 args = parser.parse_args() |
994 return RunTestsCommand(args, parser) | 1001 return RunTestsCommand(args, parser) |
995 | 1002 |
996 | 1003 |
997 if __name__ == '__main__': | 1004 if __name__ == '__main__': |
998 sys.exit(main()) | 1005 sys.exit(main()) |
OLD | NEW |