| 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 _DEFAULT_PLATFORM_MODE_TESTS = ['gtest', 'instrumentation', 'perf'] | 796 # TODO(rnephew): Add perf when ready to switch to platform mode as default. |
| 797 _DEFAULT_PLATFORM_MODE_TESTS = ['gtest', 'instrumentation'] |
| 797 | 798 |
| 798 | 799 |
| 799 def RunTestsCommand(args): # pylint: disable=too-many-return-statements | 800 def RunTestsCommand(args): # pylint: disable=too-many-return-statements |
| 800 """Checks test type and dispatches to the appropriate function. | 801 """Checks test type and dispatches to the appropriate function. |
| 801 | 802 |
| 802 Args: | 803 Args: |
| 803 args: argparse.Namespace object. | 804 args: argparse.Namespace object. |
| 804 | 805 |
| 805 Returns: | 806 Returns: |
| 806 Integer indicated exit code. | 807 Integer indicated exit code. |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 if e.is_infra_error: | 1003 if e.is_infra_error: |
| 1003 return constants.INFRA_EXIT_CODE | 1004 return constants.INFRA_EXIT_CODE |
| 1004 return constants.ERROR_EXIT_CODE | 1005 return constants.ERROR_EXIT_CODE |
| 1005 except: # pylint: disable=W0702 | 1006 except: # pylint: disable=W0702 |
| 1006 logging.exception('Unrecognized error occurred.') | 1007 logging.exception('Unrecognized error occurred.') |
| 1007 return constants.ERROR_EXIT_CODE | 1008 return constants.ERROR_EXIT_CODE |
| 1008 | 1009 |
| 1009 | 1010 |
| 1010 if __name__ == '__main__': | 1011 if __name__ == '__main__': |
| 1011 sys.exit(main()) | 1012 sys.exit(main()) |
| OLD | NEW |