| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 dest='test_filter', | 380 dest='test_filter', |
| 381 help='Test filter (if not fully qualified, will run all matches).') | 381 help='Test filter (if not fully qualified, will run all matches).') |
| 382 parser.add_argument( | 382 parser.add_argument( |
| 383 '--gtest_also_run_disabled_tests', '--gtest-also-run-disabled-tests', | 383 '--gtest_also_run_disabled_tests', '--gtest-also-run-disabled-tests', |
| 384 dest='run_disabled', action='store_true', | 384 dest='run_disabled', action='store_true', |
| 385 help='Also run disabled tests if applicable.') | 385 help='Also run disabled tests if applicable.') |
| 386 parser.add_argument( | 386 parser.add_argument( |
| 387 '--render-results-directory', | 387 '--render-results-directory', |
| 388 dest='render_results_dir', | 388 dest='render_results_dir', |
| 389 help='Directory to pull render test result images off of the device to.') | 389 help='Directory to pull render test result images off of the device to.') |
| 390 parser.add_argument( |
| 391 '--enable-relocation-packing', |
| 392 dest='enable_relocation_packing', |
| 393 action='store_true', |
| 394 help='Whether relocation packing is enabled.') |
| 390 def package_replacement(arg): | 395 def package_replacement(arg): |
| 391 split_arg = arg.split(',') | 396 split_arg = arg.split(',') |
| 392 if len(split_arg) != 2: | 397 if len(split_arg) != 2: |
| 393 raise argparse.ArgumentError( | 398 raise argparse.ArgumentError( |
| 394 'Expected two comma-separated strings for --replace-system-package, ' | 399 'Expected two comma-separated strings for --replace-system-package, ' |
| 395 'received %d' % len(split_arg)) | 400 'received %d' % len(split_arg)) |
| 396 PackageReplacement = collections.namedtuple('PackageReplacement', | 401 PackageReplacement = collections.namedtuple('PackageReplacement', |
| 397 ['package', 'replacement_apk']) | 402 ['package', 'replacement_apk']) |
| 398 return PackageReplacement(package=split_arg[0], | 403 return PackageReplacement(package=split_arg[0], |
| 399 replacement_apk=os.path.realpath(split_arg[1])) | 404 replacement_apk=os.path.realpath(split_arg[1])) |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 if e.is_infra_error: | 968 if e.is_infra_error: |
| 964 return constants.INFRA_EXIT_CODE | 969 return constants.INFRA_EXIT_CODE |
| 965 return constants.ERROR_EXIT_CODE | 970 return constants.ERROR_EXIT_CODE |
| 966 except: # pylint: disable=W0702 | 971 except: # pylint: disable=W0702 |
| 967 logging.exception('Unrecognized error occurred.') | 972 logging.exception('Unrecognized error occurred.') |
| 968 return constants.ERROR_EXIT_CODE | 973 return constants.ERROR_EXIT_CODE |
| 969 | 974 |
| 970 | 975 |
| 971 if __name__ == '__main__': | 976 if __name__ == '__main__': |
| 972 sys.exit(main()) | 977 sys.exit(main()) |
| OLD | NEW |