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