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 option_parser.add_option('--test_data', action='append', | 140 option_parser.add_option('--test_data', action='append', default=[], |
141 help=('Each instance defines a directory of test ' | 141 help=('Each instance defines a directory of test ' |
142 'data that should be copied to the target(s) ' | 142 'data that should be copied to the target(s) ' |
143 'before running the tests. The argument ' | 143 'before running the tests. The argument ' |
144 'should be of the form <target>:<source>, ' | 144 'should be of the form <target>:<source>, ' |
145 '<target> is relative to the device data' | 145 '<target> is relative to the device data' |
146 'directory, and <source> is relative to the ' | 146 'directory, and <source> is relative to the ' |
147 'chromium build directory.')) | 147 'chromium build directory.')) |
148 | 148 |
149 def ValidateInstrumentationOptions(option_parser, options, args): | 149 def ValidateInstrumentationOptions(option_parser, options, args): |
150 """Validate options/arguments and populate options with defaults.""" | 150 """Validate options/arguments and populate options with defaults.""" |
(...skipping 24 matching lines...) Expand all Loading... |
175 '%s.apk' % options.test_apk) | 175 '%s.apk' % options.test_apk) |
176 options.test_apk_jar_path = os.path.join( | 176 options.test_apk_jar_path = os.path.join( |
177 _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, |
178 '%s.jar' % options.test_apk) | 178 '%s.jar' % options.test_apk) |
179 if options.annotation_str: | 179 if options.annotation_str: |
180 options.annotation = options.annotation_str.split() | 180 options.annotation = options.annotation_str.split() |
181 elif options.test_filter: | 181 elif options.test_filter: |
182 options.annotation = [] | 182 options.annotation = [] |
183 else: | 183 else: |
184 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 184 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
OLD | NEW |