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