OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Parses options for the instrumentation tests.""" | 5 """Parses options for the instrumentation tests.""" |
6 | 6 |
7 import constants | 7 import constants |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 dest='flakiness_dashboard_server', | 130 dest='flakiness_dashboard_server', |
131 help=('Address of the server that is hosting the ' | 131 help=('Address of the server that is hosting the ' |
132 'Chrome for Android flakiness dashboard.')) | 132 'Chrome for Android flakiness dashboard.')) |
133 option_parser.add_option('--buildbot-step-failure', | 133 option_parser.add_option('--buildbot-step-failure', |
134 action='store_true', | 134 action='store_true', |
135 help=('If present, will set the buildbot status ' | 135 help=('If present, will set the buildbot status ' |
136 'as STEP_FAILURE, otherwise as STEP_WARNINGS ' | 136 'as STEP_FAILURE, otherwise as STEP_WARNINGS ' |
137 'when test(s) fail.')) | 137 'when test(s) fail.')) |
138 option_parser.add_option('--disable_assertions', action='store_true', | 138 option_parser.add_option('--disable_assertions', action='store_true', |
139 help='Run with java assertions disabled.') | 139 help='Run with java assertions disabled.') |
140 | 140 option_parser.add_option('--test_data', action='append', |
| 141 help=('Each instance defines a directory of test ' |
| 142 'data that should be copied to the target(s) ' |
| 143 'before running the tests. The argument ' |
| 144 'should be of the form <target>:<source>, ' |
| 145 '<target> is relative to the device data' |
| 146 'directory, and <source> is relative to the ' |
| 147 'chromium build directory.')) |
141 | 148 |
142 def ValidateInstrumentationOptions(option_parser, options, args): | 149 def ValidateInstrumentationOptions(option_parser, options, args): |
143 """Validate options/arguments and populate options with defaults.""" | 150 """Validate options/arguments and populate options with defaults.""" |
144 if len(args) > 1: | 151 if len(args) > 1: |
145 option_parser.print_help(sys.stderr) | 152 option_parser.print_help(sys.stderr) |
146 option_parser.error('Unknown arguments: %s' % args[1:]) | 153 option_parser.error('Unknown arguments: %s' % args[1:]) |
147 if options.java_only and options.python_only: | 154 if options.java_only and options.python_only: |
148 option_parser.error('Options java_only (-j) and python_only (-p) ' | 155 option_parser.error('Options java_only (-j) and python_only (-p) ' |
149 'are mutually exclusive.') | 156 'are mutually exclusive.') |
150 if not options.test_apk: | 157 if not options.test_apk: |
(...skipping 17 matching lines...) Expand all Loading... |
168 '%s.apk' % options.test_apk) | 175 '%s.apk' % options.test_apk) |
169 options.test_apk_jar_path = os.path.join( | 176 options.test_apk_jar_path = os.path.join( |
170 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, | 177 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, |
171 '%s.jar' % options.test_apk) | 178 '%s.jar' % options.test_apk) |
172 if options.annotation_str: | 179 if options.annotation_str: |
173 options.annotation = options.annotation_str.split() | 180 options.annotation = options.annotation_str.split() |
174 elif options.test_filter: | 181 elif options.test_filter: |
175 options.annotation = [] | 182 options.annotation = [] |
176 else: | 183 else: |
177 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 184 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
OLD | NEW |