| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 options.run_java_tests = True | 160 options.run_java_tests = True |
| 161 options.run_python_tests = True | 161 options.run_python_tests = True |
| 162 if options.java_only: | 162 if options.java_only: |
| 163 options.run_python_tests = False | 163 options.run_python_tests = False |
| 164 elif options.python_only: | 164 elif options.python_only: |
| 165 options.run_java_tests = False | 165 options.run_java_tests = False |
| 166 | 166 |
| 167 if os.path.exists(options.test_apk): | 167 if os.path.exists(options.test_apk): |
| 168 # The APK is fully qualified, assume the JAR lives along side. | 168 # The APK is fully qualified, assume the JAR lives along side. |
| 169 options.test_apk_path = options.test_apk | 169 options.test_apk_path = options.test_apk |
| 170 options.test_apk_jar_path = os.path.splitext(options.test_apk_path) + '.jar' | 170 options.test_apk_jar_path = (os.path.splitext(options.test_apk_path)[0] + |
| 171 '.jar') |
| 171 else: | 172 else: |
| 172 options.test_apk_path = os.path.join(_SDK_OUT_DIR, | 173 options.test_apk_path = os.path.join(_SDK_OUT_DIR, |
| 173 options.build_type, | 174 options.build_type, |
| 174 constants.SDK_BUILD_APKS_DIR, | 175 constants.SDK_BUILD_APKS_DIR, |
| 175 '%s.apk' % options.test_apk) | 176 '%s.apk' % options.test_apk) |
| 176 options.test_apk_jar_path = os.path.join( | 177 options.test_apk_jar_path = os.path.join( |
| 177 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, | 178 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, |
| 178 '%s.jar' % options.test_apk) | 179 '%s.jar' % options.test_apk) |
| 179 if options.annotation_str: | 180 if options.annotation_str: |
| 180 options.annotation = options.annotation_str.split() | 181 options.annotation = options.annotation_str.split() |
| 181 elif options.test_filter: | 182 elif options.test_filter: |
| 182 options.annotation = [] | 183 options.annotation = [] |
| 183 else: | 184 else: |
| 184 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 185 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
| OLD | NEW |