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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 'should be used.')) | 108 'should be used.')) |
109 group.add_argument('--json-results-file', '--test-launcher-summary-output', | 109 group.add_argument('--json-results-file', '--test-launcher-summary-output', |
110 dest='json_results_file', type=os.path.realpath, | 110 dest='json_results_file', type=os.path.realpath, |
111 help='If set, will dump results in JSON form ' | 111 help='If set, will dump results in JSON form ' |
112 'to specified file.') | 112 'to specified file.') |
113 group.add_argument('--trace-output', metavar='FILENAME', | 113 group.add_argument('--trace-output', metavar='FILENAME', |
114 type=os.path.realpath, | 114 type=os.path.realpath, |
115 help='Path to save test_runner trace data to. This option ' | 115 help='Path to save test_runner trace data to. This option ' |
116 'has been implemented for gtest, instrumentation ' | 116 'has been implemented for gtest, instrumentation ' |
117 'test and perf test.') | 117 'test and perf test.') |
118 group.add_argument( | |
jbudorick
2017/03/01 20:19:21
Why is this moving to the generic arguments when i
| |
119 '--screenshot-directory', dest='screenshot_dir', type=os.path.realpath, | |
120 help='Capture screenshots of test failures') | |
118 | 121 |
119 logcat_output_group = group.add_mutually_exclusive_group() | 122 logcat_output_group = group.add_mutually_exclusive_group() |
120 logcat_output_group.add_argument( | 123 logcat_output_group.add_argument( |
121 '--logcat-output-dir', type=os.path.realpath, | 124 '--logcat-output-dir', type=os.path.realpath, |
122 help='If set, will dump logcats recorded during test run to directory. ' | 125 help='If set, will dump logcats recorded during test run to directory. ' |
123 'File names will be the device ids with timestamps.') | 126 'File names will be the device ids with timestamps.') |
124 logcat_output_group.add_argument( | 127 logcat_output_group.add_argument( |
125 '--logcat-output-file', type=os.path.realpath, | 128 '--logcat-output-file', type=os.path.realpath, |
126 help='If set, will merge logcats recorded during test run and dump them ' | 129 help='If set, will merge logcats recorded during test run and dump them ' |
127 'to the specified file.') | 130 'to the specified file.') |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 '-A', '--annotation', dest='annotation_str', | 282 '-A', '--annotation', dest='annotation_str', |
280 help=('Comma-separated list of annotations. Run only tests with any of ' | 283 help=('Comma-separated list of annotations. Run only tests with any of ' |
281 'the given annotations. An annotation can be either a key or a ' | 284 'the given annotations. An annotation can be either a key or a ' |
282 'key-values pair. A test that has no annotation is considered ' | 285 'key-values pair. A test that has no annotation is considered ' |
283 '"SmallTest".')) | 286 '"SmallTest".')) |
284 argument_group.add_argument( | 287 argument_group.add_argument( |
285 '-E', '--exclude-annotation', dest='exclude_annotation_str', | 288 '-E', '--exclude-annotation', dest='exclude_annotation_str', |
286 help=('Comma-separated list of annotations. Exclude tests with these ' | 289 help=('Comma-separated list of annotations. Exclude tests with these ' |
287 'annotations.')) | 290 'annotations.')) |
288 argument_group.add_argument( | 291 argument_group.add_argument( |
289 '--screenshot-directory', dest='screenshot_dir', type=os.path.realpath, | |
290 help='Capture screenshots of test failures') | |
291 argument_group.add_argument( | |
292 '--save-perf-json', action='store_true', | 292 '--save-perf-json', action='store_true', |
293 help='Saves the JSON file for each UI Perf test.') | 293 help='Saves the JSON file for each UI Perf test.') |
294 argument_group.add_argument( | 294 argument_group.add_argument( |
295 '--official-build', action='store_true', help='Run official build tests.') | 295 '--official-build', action='store_true', help='Run official build tests.') |
296 argument_group.add_argument( | 296 argument_group.add_argument( |
297 '--disable-dalvik-asserts', dest='set_asserts', action='store_false', | 297 '--disable-dalvik-asserts', dest='set_asserts', action='store_false', |
298 default=True, help='Removes the dalvik.vm.enableassertions property') | 298 default=True, help='Removes the dalvik.vm.enableassertions property') |
299 argument_group.add_argument( | 299 argument_group.add_argument( |
300 '--gtest_also_run_disabled_tests', '--gtest-also-run-disabled-tests', | 300 '--gtest_also_run_disabled_tests', '--gtest-also-run-disabled-tests', |
301 dest='run_disabled', action='store_true', | 301 dest='run_disabled', action='store_true', |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 if e.is_infra_error: | 853 if e.is_infra_error: |
854 return constants.INFRA_EXIT_CODE | 854 return constants.INFRA_EXIT_CODE |
855 return constants.ERROR_EXIT_CODE | 855 return constants.ERROR_EXIT_CODE |
856 except: # pylint: disable=W0702 | 856 except: # pylint: disable=W0702 |
857 logging.exception('Unrecognized error occurred.') | 857 logging.exception('Unrecognized error occurred.') |
858 return constants.ERROR_EXIT_CODE | 858 return constants.ERROR_EXIT_CODE |
859 | 859 |
860 | 860 |
861 if __name__ == '__main__': | 861 if __name__ == '__main__': |
862 sys.exit(main()) | 862 sys.exit(main()) |
OLD | NEW |