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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 '--gtest-also-run-disabled-tests', | 189 '--gtest-also-run-disabled-tests', |
190 dest='run_disabled', action='store_true', | 190 dest='run_disabled', action='store_true', |
191 help='Also run disabled tests if applicable.') | 191 help='Also run disabled tests if applicable.') |
192 group.add_argument('-a', '--test-arguments', dest='test_arguments', | 192 group.add_argument('-a', '--test-arguments', dest='test_arguments', |
193 default='', | 193 default='', |
194 help='Additional arguments to pass to the test.') | 194 help='Additional arguments to pass to the test.') |
195 group.add_argument('-t', '--shard-timeout', | 195 group.add_argument('-t', '--shard-timeout', |
196 dest='shard_timeout', type=int, default=120, | 196 dest='shard_timeout', type=int, default=120, |
197 help='Timeout to wait for each test ' | 197 help='Timeout to wait for each test ' |
198 '(default: %(default)s).') | 198 '(default: %(default)s).') |
199 # TODO(jbudorick): Remove this after ensuring nothing else uses it. | |
200 group.add_argument('--isolate_file_path', | 199 group.add_argument('--isolate_file_path', |
201 '--isolate-file-path', | 200 '--isolate-file-path', |
202 dest='isolate_file_path', | 201 dest='isolate_file_path', |
203 type=os.path.realpath, | 202 type=os.path.realpath, |
204 help=argparse.SUPPRESS) | 203 help='.isolate file path to override the default ' |
205 group.add_argument('--runtime-deps-path', | 204 'path') |
206 dest='runtime_deps_path', | |
207 type=os.path.realpath, | |
208 help='Runtime data dependency file from GN.') | |
209 group.add_argument('--app-data-file', action='append', dest='app_data_files', | 205 group.add_argument('--app-data-file', action='append', dest='app_data_files', |
210 help='A file path relative to the app data directory ' | 206 help='A file path relative to the app data directory ' |
211 'that should be saved to the host.') | 207 'that should be saved to the host.') |
212 group.add_argument('--app-data-file-dir', | 208 group.add_argument('--app-data-file-dir', |
213 help='Host directory to which app data files will be' | 209 help='Host directory to which app data files will be' |
214 ' saved. Used with --app-data-file.') | 210 ' saved. Used with --app-data-file.') |
215 group.add_argument('--delete-stale-data', dest='delete_stale_data', | 211 group.add_argument('--delete-stale-data', dest='delete_stale_data', |
216 action='store_true', | 212 action='store_true', |
217 help='Delete stale test data on the device.') | 213 help='Delete stale test data on the device.') |
218 group.add_argument('--repeat', '--gtest_repeat', '--gtest-repeat', | 214 group.add_argument('--repeat', '--gtest_repeat', '--gtest-repeat', |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 group.add_argument('--coverage-dir', type=os.path.realpath, | 353 group.add_argument('--coverage-dir', type=os.path.realpath, |
358 help=('Directory in which to place all generated ' | 354 help=('Directory in which to place all generated ' |
359 'EMMA coverage files.')) | 355 'EMMA coverage files.')) |
360 group.add_argument('--device-flags', dest='device_flags', | 356 group.add_argument('--device-flags', dest='device_flags', |
361 type=os.path.realpath, | 357 type=os.path.realpath, |
362 help='The relative filepath to a file containing ' | 358 help='The relative filepath to a file containing ' |
363 'command-line flags to set on the device') | 359 'command-line flags to set on the device') |
364 group.add_argument('--device-flags-file', type=os.path.realpath, | 360 group.add_argument('--device-flags-file', type=os.path.realpath, |
365 help='The relative filepath to a file containing ' | 361 help='The relative filepath to a file containing ' |
366 'command-line flags to set on the device') | 362 'command-line flags to set on the device') |
367 # TODO(jbudorick): Remove this after ensuring nothing else uses it. | |
368 group.add_argument('--isolate_file_path', | 363 group.add_argument('--isolate_file_path', |
369 '--isolate-file-path', | 364 '--isolate-file-path', |
370 dest='isolate_file_path', | 365 dest='isolate_file_path', |
371 type=os.path.realpath, | 366 type=os.path.realpath, |
372 help=argparse.SUPPRESS) | 367 help='.isolate file path to override the default ' |
373 group.add_argument('--runtime-deps-path', | 368 'path') |
374 dest='runtime_deps_path', | |
375 type=os.path.realpath, | |
376 help='Runtime data dependency file from GN.') | |
377 group.add_argument('--delete-stale-data', dest='delete_stale_data', | 369 group.add_argument('--delete-stale-data', dest='delete_stale_data', |
378 action='store_true', | 370 action='store_true', |
379 help='Delete stale test data on the device.') | 371 help='Delete stale test data on the device.') |
380 group.add_argument('--timeout-scale', type=float, | 372 group.add_argument('--timeout-scale', type=float, |
381 help='Factor by which timeouts should be scaled.') | 373 help='Factor by which timeouts should be scaled.') |
382 group.add_argument('--strict-mode', dest='strict_mode', default='testing', | 374 group.add_argument('--strict-mode', dest='strict_mode', default='testing', |
383 help='StrictMode command-line flag set on the device, ' | 375 help='StrictMode command-line flag set on the device, ' |
384 'death/testing to kill the process, off to stop ' | 376 'death/testing to kill the process, off to stop ' |
385 'checking, flash to flash only. Default testing.') | 377 'checking, flash to flash only. Default testing.') |
386 group.add_argument('--regenerate-goldens', dest='regenerate_goldens', | 378 group.add_argument('--regenerate-goldens', dest='regenerate_goldens', |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 if e.is_infra_error: | 837 if e.is_infra_error: |
846 return constants.INFRA_EXIT_CODE | 838 return constants.INFRA_EXIT_CODE |
847 return constants.ERROR_EXIT_CODE | 839 return constants.ERROR_EXIT_CODE |
848 except: # pylint: disable=W0702 | 840 except: # pylint: disable=W0702 |
849 logging.exception('Unrecognized error occurred.') | 841 logging.exception('Unrecognized error occurred.') |
850 return constants.ERROR_EXIT_CODE | 842 return constants.ERROR_EXIT_CODE |
851 | 843 |
852 | 844 |
853 if __name__ == '__main__': | 845 if __name__ == '__main__': |
854 sys.exit(main()) | 846 sys.exit(main()) |
OLD | NEW |