Chromium Code Reviews| 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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 Exception: Unknown command name passed in, or an exception from an | 914 Exception: Unknown command name passed in, or an exception from an |
| 915 individual test runner. | 915 individual test runner. |
| 916 """ | 916 """ |
| 917 command = args.command | 917 command = args.command |
| 918 | 918 |
| 919 ProcessCommonOptions(args) | 919 ProcessCommonOptions(args) |
| 920 | 920 |
| 921 if args.enable_platform_mode: | 921 if args.enable_platform_mode: |
| 922 return RunTestsInPlatformMode(args, parser) | 922 return RunTestsInPlatformMode(args, parser) |
| 923 | 923 |
| 924 if command in constants.LOCAL_MACHINE_TESTS: | |
|
jbudorick
2015/10/09 01:00:20
This was already skipping the device check for pyt
agrieve
2015/10/09 01:04:39
oooooooh. I got it.
Removed the LOCAL_MACHINE_TEST
| |
| 925 devices = [] | |
| 926 else: | |
| 927 devices = _GetAttachedDevices(args.blacklist_file, args.test_device, | |
| 928 args.enable_device_cache) | |
| 929 | |
| 930 forwarder.Forwarder.RemoveHostLog() | 924 forwarder.Forwarder.RemoveHostLog() |
| 931 if not ports.ResetTestServerPortAllocation(): | 925 if not ports.ResetTestServerPortAllocation(): |
| 932 raise Exception('Failed to reset test server port.') | 926 raise Exception('Failed to reset test server port.') |
| 933 | 927 |
| 928 def get_devices(): | |
| 929 if command in constants.LOCAL_MACHINE_TESTS: | |
| 930 return [] | |
| 931 return _GetAttachedDevices(args.blacklist_file, args.test_device, | |
| 932 args.enable_device_cache) | |
| 933 | |
| 934 if command == 'gtest': | 934 if command == 'gtest': |
| 935 return RunTestsInPlatformMode(args, parser) | 935 return RunTestsInPlatformMode(args, parser) |
| 936 elif command == 'linker': | 936 elif command == 'linker': |
| 937 return _RunLinkerTests(args, devices) | 937 return _RunLinkerTests(args, get_devices()) |
| 938 elif command == 'instrumentation': | 938 elif command == 'instrumentation': |
| 939 return _RunInstrumentationTests(args, devices) | 939 return _RunInstrumentationTests(args, get_devices()) |
| 940 elif command == 'uiautomator': | 940 elif command == 'uiautomator': |
| 941 return _RunUIAutomatorTests(args, devices) | 941 return _RunUIAutomatorTests(args, get_devices()) |
| 942 elif command == 'junit': | 942 elif command == 'junit': |
| 943 return _RunJUnitTests(args) | 943 return _RunJUnitTests(args) |
| 944 elif command == 'monkey': | 944 elif command == 'monkey': |
| 945 return _RunMonkeyTests(args, devices) | 945 return _RunMonkeyTests(args, get_devices()) |
| 946 elif command == 'perf': | 946 elif command == 'perf': |
| 947 return _RunPerfTests(args, devices) | 947 return _RunPerfTests(args, get_devices()) |
| 948 elif command == 'python': | 948 elif command == 'python': |
| 949 return _RunPythonTests(args) | 949 return _RunPythonTests(args) |
| 950 else: | 950 else: |
| 951 raise Exception('Unknown test type.') | 951 raise Exception('Unknown test type.') |
| 952 | 952 |
| 953 | 953 |
| 954 _SUPPORTED_IN_PLATFORM_MODE = [ | 954 _SUPPORTED_IN_PLATFORM_MODE = [ |
| 955 # TODO(jbudorick): Add support for more test types. | 955 # TODO(jbudorick): Add support for more test types. |
| 956 'gtest', | 956 'gtest', |
| 957 'instrumentation', | 957 'instrumentation', |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1056 if e.is_infra_error: | 1056 if e.is_infra_error: |
| 1057 return constants.INFRA_EXIT_CODE | 1057 return constants.INFRA_EXIT_CODE |
| 1058 return constants.ERROR_EXIT_CODE | 1058 return constants.ERROR_EXIT_CODE |
| 1059 except: # pylint: disable=W0702 | 1059 except: # pylint: disable=W0702 |
| 1060 logging.exception('Unrecognized error occurred.') | 1060 logging.exception('Unrecognized error occurred.') |
| 1061 return constants.ERROR_EXIT_CODE | 1061 return constants.ERROR_EXIT_CODE |
| 1062 | 1062 |
| 1063 | 1063 |
| 1064 if __name__ == '__main__': | 1064 if __name__ == '__main__': |
| 1065 sys.exit(main()) | 1065 sys.exit(main()) |
| OLD | NEW |