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 #TODO(craigdh): pylib/utils/ should not depend on pylib/. | 7 #TODO(craigdh): pylib/utils/ should not depend on pylib/. |
8 from pylib import constants | 8 from pylib import constants |
9 | 9 |
10 import optparse | 10 import optparse |
(...skipping 25 matching lines...) Expand all Loading... |
36 ' application (with the .apk extension).')) | 36 ' application (with the .apk extension).')) |
37 option_parser.add_option('--apk_package', | 37 option_parser.add_option('--apk_package', |
38 help=('The package name used by the apk containing ' | 38 help=('The package name used by the apk containing ' |
39 'the application.')) | 39 'the application.')) |
40 | 40 |
41 | 41 |
42 def ValidateInstallAPKOption(option_parser, options): | 42 def ValidateInstallAPKOption(option_parser, options): |
43 if not options.apk: | 43 if not options.apk: |
44 option_parser.error('--apk is mandatory.') | 44 option_parser.error('--apk is mandatory.') |
45 if not os.path.exists(options.apk): | 45 if not os.path.exists(options.apk): |
46 options.apk = os.path.join(os.environ['CHROME_SRC'], | 46 options.apk = os.path.join(constants.CHROME_DIR, |
47 'out', options.build_type, | 47 'out', options.build_type, |
48 'apks', options.apk) | 48 'apks', options.apk) |
49 | 49 |
50 | 50 |
51 def AddTestRunnerOptions(option_parser, default_timeout=60): | 51 def AddTestRunnerOptions(option_parser, default_timeout=60): |
52 """Decorates OptionParser with options applicable to all tests.""" | 52 """Decorates OptionParser with options applicable to all tests.""" |
53 | 53 |
54 option_parser.add_option('-t', dest='timeout', | 54 option_parser.add_option('-t', dest='timeout', |
55 help='Timeout to wait for each test', | 55 help='Timeout to wait for each test', |
56 type='int', | 56 type='int', |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 '%s.apk' % options.test_apk) | 230 '%s.apk' % options.test_apk) |
231 options.test_apk_jar_path = os.path.join( | 231 options.test_apk_jar_path = os.path.join( |
232 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, | 232 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, |
233 '%s.jar' % options.test_apk) | 233 '%s.jar' % options.test_apk) |
234 if options.annotation_str: | 234 if options.annotation_str: |
235 options.annotation = options.annotation_str.split() | 235 options.annotation = options.annotation_str.split() |
236 elif options.test_filter: | 236 elif options.test_filter: |
237 options.annotation = [] | 237 options.annotation = [] |
238 else: | 238 else: |
239 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 239 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
OLD | NEW |