| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 group.add_argument('--known-devices-file', help='Path to known device list.') | 549 group.add_argument('--known-devices-file', help='Path to known device list.') |
| 550 group.add_argument( | 550 group.add_argument( |
| 551 '--repeat', dest='repeat', type=int, default=0, | 551 '--repeat', dest='repeat', type=int, default=0, |
| 552 help='Number of times to repeat the specified set of tests.') | 552 help='Number of times to repeat the specified set of tests.') |
| 553 group.add_argument( | 553 group.add_argument( |
| 554 '--break-on-failure', '--break_on_failure', dest='break_on_failure', | 554 '--break-on-failure', '--break_on_failure', dest='break_on_failure', |
| 555 action='store_true', help='Whether to break on failure.') | 555 action='store_true', help='Whether to break on failure.') |
| 556 group.add_argument( | 556 group.add_argument( |
| 557 '--write-buildbot-json', action='store_true', | 557 '--write-buildbot-json', action='store_true', |
| 558 help='Whether to output buildbot json.') | 558 help='Whether to output buildbot json.') |
| 559 # TODO(rnephew): Move up to top level options when implemented on all tests. |
| 560 group.add_argument( |
| 561 '--trace-output', metavar='FILENAME', type=os.path.realpath, |
| 562 help='Path to save test_runner trace data to.') |
| 559 AddCommonOptions(parser) | 563 AddCommonOptions(parser) |
| 560 AddDeviceOptions(parser) | 564 AddDeviceOptions(parser) |
| 561 | 565 |
| 562 | 566 |
| 563 def AddPythonTestOptions(parser): | 567 def AddPythonTestOptions(parser): |
| 564 group = parser.add_argument_group('Python Test Options') | 568 group = parser.add_argument_group('Python Test Options') |
| 565 group.add_argument( | 569 group.add_argument( |
| 566 '-s', '--suite', dest='suite_name', metavar='SUITE_NAME', | 570 '-s', '--suite', dest='suite_name', metavar='SUITE_NAME', |
| 567 choices=constants.PYTHON_UNIT_TEST_SUITES.keys(), | 571 choices=constants.PYTHON_UNIT_TEST_SUITES.keys(), |
| 568 help='Name of the test suite to run.') | 572 help='Name of the test suite to run.') |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 if e.is_infra_error: | 884 if e.is_infra_error: |
| 881 return constants.INFRA_EXIT_CODE | 885 return constants.INFRA_EXIT_CODE |
| 882 return constants.ERROR_EXIT_CODE | 886 return constants.ERROR_EXIT_CODE |
| 883 except: # pylint: disable=W0702 | 887 except: # pylint: disable=W0702 |
| 884 logging.exception('Unrecognized error occurred.') | 888 logging.exception('Unrecognized error occurred.') |
| 885 return constants.ERROR_EXIT_CODE | 889 return constants.ERROR_EXIT_CODE |
| 886 | 890 |
| 887 | 891 |
| 888 if __name__ == '__main__': | 892 if __name__ == '__main__': |
| 889 sys.exit(main()) | 893 sys.exit(main()) |
| OLD | NEW |