| 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 'Did not find device %s among attached device. Attached devices: %s' | 786 'Did not find device %s among attached device. Attached devices: %s' |
| 787 % (test_device, ', '.join(attached_devices))) | 787 % (test_device, ', '.join(attached_devices))) |
| 788 return test_device | 788 return test_device |
| 789 | 789 |
| 790 else: | 790 else: |
| 791 if not attached_devices: | 791 if not attached_devices: |
| 792 raise device_errors.NoDevicesError() | 792 raise device_errors.NoDevicesError() |
| 793 return sorted(attached_devices) | 793 return sorted(attached_devices) |
| 794 | 794 |
| 795 | 795 |
| 796 # TODO(rnephew): Add perf when ready to switch to platform mode as default. | 796 _DEFAULT_PLATFORM_MODE_TESTS = ['gtest', 'instrumentation', 'perf'] |
| 797 _DEFAULT_PLATFORM_MODE_TESTS = ['gtest', 'instrumentation'] | |
| 798 | 797 |
| 799 | 798 |
| 800 def RunTestsCommand(args): # pylint: disable=too-many-return-statements | 799 def RunTestsCommand(args): # pylint: disable=too-many-return-statements |
| 801 """Checks test type and dispatches to the appropriate function. | 800 """Checks test type and dispatches to the appropriate function. |
| 802 | 801 |
| 803 Args: | 802 Args: |
| 804 args: argparse.Namespace object. | 803 args: argparse.Namespace object. |
| 805 | 804 |
| 806 Returns: | 805 Returns: |
| 807 Integer indicated exit code. | 806 Integer indicated exit code. |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 if e.is_infra_error: | 1002 if e.is_infra_error: |
| 1004 return constants.INFRA_EXIT_CODE | 1003 return constants.INFRA_EXIT_CODE |
| 1005 return constants.ERROR_EXIT_CODE | 1004 return constants.ERROR_EXIT_CODE |
| 1006 except: # pylint: disable=W0702 | 1005 except: # pylint: disable=W0702 |
| 1007 logging.exception('Unrecognized error occurred.') | 1006 logging.exception('Unrecognized error occurred.') |
| 1008 return constants.ERROR_EXIT_CODE | 1007 return constants.ERROR_EXIT_CODE |
| 1009 | 1008 |
| 1010 | 1009 |
| 1011 if __name__ == '__main__': | 1010 if __name__ == '__main__': |
| 1012 sys.exit(main()) | 1011 sys.exit(main()) |
| OLD | NEW |