| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 def AddCommonOptions(parser): | 52 def AddCommonOptions(parser): |
| 53 """Adds all common options to |parser|.""" | 53 """Adds all common options to |parser|.""" |
| 54 | 54 |
| 55 group = parser.add_argument_group('Common Options') | 55 group = parser.add_argument_group('Common Options') |
| 56 | 56 |
| 57 default_build_type = os.environ.get('BUILDTYPE', 'Debug') | 57 default_build_type = os.environ.get('BUILDTYPE', 'Debug') |
| 58 | 58 |
| 59 debug_or_release_group = group.add_mutually_exclusive_group() | 59 debug_or_release_group = group.add_mutually_exclusive_group() |
| 60 debug_or_release_group.add_argument( | 60 debug_or_release_group.add_argument( |
| 61 '--debug', action='store_const', const='Debug', dest='build_type', | 61 '--debug', action='store_const', const='Default', dest='build_type', |
| 62 default=default_build_type, | 62 default=default_build_type, |
| 63 help=('If set, run test suites under out/Debug. ' | 63 help=('If set, run test suites under out/Debug. ' |
| 64 'Default is env var BUILDTYPE or Debug.')) | 64 'Default is env var BUILDTYPE or Debug.')) |
| 65 debug_or_release_group.add_argument( | 65 debug_or_release_group.add_argument( |
| 66 '--release', action='store_const', const='Release', dest='build_type', | 66 '--release', action='store_const', const='Release', dest='build_type', |
| 67 help=('If set, run test suites under out/Release. ' | 67 help=('If set, run test suites under out/Release. ' |
| 68 'Default is env var BUILDTYPE or Debug.')) | 68 'Default is env var BUILDTYPE or Debug.')) |
| 69 | 69 |
| 70 group.add_argument('--build-directory', dest='build_directory', | 70 group.add_argument('--build-directory', dest='build_directory', |
| 71 help=('Path to the directory in which build files are' | 71 help=('Path to the directory in which build files are' |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 if e.is_infra_error: | 981 if e.is_infra_error: |
| 982 return constants.INFRA_EXIT_CODE | 982 return constants.INFRA_EXIT_CODE |
| 983 return constants.ERROR_EXIT_CODE | 983 return constants.ERROR_EXIT_CODE |
| 984 except: # pylint: disable=W0702 | 984 except: # pylint: disable=W0702 |
| 985 logging.exception('Unrecognized error occurred.') | 985 logging.exception('Unrecognized error occurred.') |
| 986 return constants.ERROR_EXIT_CODE | 986 return constants.ERROR_EXIT_CODE |
| 987 | 987 |
| 988 | 988 |
| 989 if __name__ == '__main__': | 989 if __name__ == '__main__': |
| 990 sys.exit(main()) | 990 sys.exit(main()) |
| OLD | NEW |