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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 | 968 |
969 Raises: | 969 Raises: |
970 Exception: Unknown command name passed in, or an exception from an | 970 Exception: Unknown command name passed in, or an exception from an |
971 individual test runner. | 971 individual test runner. |
972 """ | 972 """ |
973 command = args.command | 973 command = args.command |
974 | 974 |
975 ProcessCommonOptions(args) | 975 ProcessCommonOptions(args) |
976 logging.info('command: %s', ' '.join(sys.argv)) | 976 logging.info('command: %s', ' '.join(sys.argv)) |
977 | 977 |
978 if args.enable_platform_mode: | 978 if args.enable_platform_mode or command in ('gtest', 'instrumentation'): |
979 return RunTestsInPlatformMode(args) | 979 return RunTestsInPlatformMode(args) |
980 | 980 |
981 forwarder.Forwarder.RemoveHostLog() | 981 forwarder.Forwarder.RemoveHostLog() |
982 if not ports.ResetTestServerPortAllocation(): | 982 if not ports.ResetTestServerPortAllocation(): |
983 raise Exception('Failed to reset test server port.') | 983 raise Exception('Failed to reset test server port.') |
984 | 984 |
985 def get_devices(): | 985 def get_devices(): |
986 return _GetAttachedDevices(args.blacklist_file, args.test_device, | 986 return _GetAttachedDevices(args.blacklist_file, args.test_device, |
987 args.enable_device_cache) | 987 args.enable_device_cache) |
988 | 988 |
989 if command == 'gtest': | 989 if command == 'linker': |
990 return RunTestsInPlatformMode(args) | |
991 elif command == 'linker': | |
992 return _RunLinkerTests(args, get_devices()) | 990 return _RunLinkerTests(args, get_devices()) |
993 elif command == 'instrumentation': | |
994 return _RunInstrumentationTests(args, get_devices()) | |
995 elif command == 'junit': | 991 elif command == 'junit': |
996 return _RunJUnitTests(args) | 992 return _RunJUnitTests(args) |
997 elif command == 'monkey': | 993 elif command == 'monkey': |
998 return _RunMonkeyTests(args, get_devices()) | 994 return _RunMonkeyTests(args, get_devices()) |
999 elif command == 'perf': | 995 elif command == 'perf': |
1000 return _RunPerfTests(args, get_devices()) | 996 return _RunPerfTests(args, get_devices()) |
1001 elif command == 'python': | 997 elif command == 'python': |
1002 return _RunPythonTests(args) | 998 return _RunPythonTests(args) |
1003 else: | 999 else: |
1004 raise Exception('Unknown test type.') | 1000 raise Exception('Unknown test type.') |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 if e.is_infra_error: | 1135 if e.is_infra_error: |
1140 return constants.INFRA_EXIT_CODE | 1136 return constants.INFRA_EXIT_CODE |
1141 return constants.ERROR_EXIT_CODE | 1137 return constants.ERROR_EXIT_CODE |
1142 except: # pylint: disable=W0702 | 1138 except: # pylint: disable=W0702 |
1143 logging.exception('Unrecognized error occurred.') | 1139 logging.exception('Unrecognized error occurred.') |
1144 return constants.ERROR_EXIT_CODE | 1140 return constants.ERROR_EXIT_CODE |
1145 | 1141 |
1146 | 1142 |
1147 if __name__ == '__main__': | 1143 if __name__ == '__main__': |
1148 sys.exit(main()) | 1144 sys.exit(main()) |
OLD | NEW |