OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Defer to run_test_cases.py.""" | 6 """Defer to run_test_cases.py.""" |
7 | 7 |
8 import os | 8 import os |
9 import optparse | 9 import optparse |
10 import sys | 10 import sys |
11 | 11 |
12 ROOT_DIR = os.path.dirname( | 12 ROOT_DIR = os.path.dirname( |
13 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 13 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
14 | 14 |
15 | 15 |
16 def pop_known_arguments(args): | 16 def pop_known_arguments(args): |
17 """Extracts known arguments from the args if present.""" | 17 """Extracts known arguments from the args if present.""" |
18 rest = [] | 18 rest = [] |
19 run_test_cases_extra_args = [] | 19 run_test_cases_extra_args = [] |
20 for arg in args: | 20 for arg in args: |
21 if arg.startswith(('--gtest_filter=', '--gtest_output=', '--clusters=')): | 21 if arg.startswith(('--gtest_filter=', '--gtest_output=', '--clusters=')): |
22 run_test_cases_extra_args.append(arg) | 22 run_test_cases_extra_args.append(arg) |
23 elif arg == '--run-manual': | 23 elif arg in ('--run-manual', '--verbose'): |
24 run_test_cases_extra_args.append(arg) | 24 run_test_cases_extra_args.append(arg) |
25 elif arg == '--gtest_print_time': | 25 elif arg == '--gtest_print_time': |
26 # Ignore. | 26 # Ignore. |
27 pass | 27 pass |
28 elif 'interactive_ui_tests' in arg: | 28 elif 'interactive_ui_tests' in arg: |
29 # Run this test in a single thread. It is useful to run it under | 29 # Run this test in a single thread. It is useful to run it under |
30 # run_test_cases so automatic flaky test workaround is still used. | 30 # run_test_cases so automatic flaky test workaround is still used. |
31 run_test_cases_extra_args.append('-j1') | 31 run_test_cases_extra_args.append('-j1') |
32 rest.append(arg) | 32 rest.append(arg) |
33 elif 'browser_tests' in arg: | 33 elif 'browser_tests' in arg: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 run_test_cases_extra_args, rest = pop_known_arguments(args) | 94 run_test_cases_extra_args, rest = pop_known_arguments(args) |
95 | 95 |
96 import run_test_cases # pylint: disable=F0401 | 96 import run_test_cases # pylint: disable=F0401 |
97 | 97 |
98 return run_test_cases.main(cmd + run_test_cases_extra_args + ['--'] + rest) | 98 return run_test_cases.main(cmd + run_test_cases_extra_args + ['--'] + rest) |
99 | 99 |
100 | 100 |
101 if __name__ == '__main__': | 101 if __name__ == '__main__': |
102 sys.exit(main()) | 102 sys.exit(main()) |
OLD | NEW |