OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """Helper class for instrumenation test jar.""" | 5 """Helper class for instrumenation test jar.""" |
6 # pylint: disable=W0702 | 6 # pylint: disable=W0702 |
7 | 7 |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import pickle | 10 import pickle |
(...skipping 27 matching lines...) Expand all Loading... |
38 _PROGUARD_METHOD_RE = re.compile(r'\s*?- Method:\s*(\S*)[(].*$') | 38 _PROGUARD_METHOD_RE = re.compile(r'\s*?- Method:\s*(\S*)[(].*$') |
39 _PROGUARD_ANNOTATION_RE = re.compile(r'\s*?- Annotation \[L(\S*);\]:$') | 39 _PROGUARD_ANNOTATION_RE = re.compile(r'\s*?- Annotation \[L(\S*);\]:$') |
40 _PROGUARD_ANNOTATION_CONST_RE = ( | 40 _PROGUARD_ANNOTATION_CONST_RE = ( |
41 re.compile(r'\s*?- Constant element value.*$')) | 41 re.compile(r'\s*?- Constant element value.*$')) |
42 _PROGUARD_ANNOTATION_VALUE_RE = re.compile(r'\s*?- \S+? \[(.*)\]$') | 42 _PROGUARD_ANNOTATION_VALUE_RE = re.compile(r'\s*?- \S+? \[(.*)\]$') |
43 | 43 |
44 def __init__(self, jar_path): | 44 def __init__(self, jar_path): |
45 if not os.path.exists(jar_path): | 45 if not os.path.exists(jar_path): |
46 raise Exception('%s not found, please build it' % jar_path) | 46 raise Exception('%s not found, please build it' % jar_path) |
47 | 47 |
48 self._PROGUARD_PATH = os.path.join(constants.ANDROID_SDK_ROOT, | 48 self._PROGUARD_PATH = os.path.join(constants.PROGUARD_ROOT, |
49 'tools/proguard/lib/proguard.jar') | 49 'lib', 'proguard.jar') |
50 if not os.path.exists(self._PROGUARD_PATH): | 50 if not os.path.exists(self._PROGUARD_PATH): |
51 self._PROGUARD_PATH = os.path.join(os.environ['ANDROID_BUILD_TOP'], | 51 self._PROGUARD_PATH = os.path.join(os.environ['ANDROID_BUILD_TOP'], |
52 'external/proguard/lib/proguard.jar') | 52 'external/proguard/lib/proguard.jar') |
53 self._jar_path = jar_path | 53 self._jar_path = jar_path |
54 self._pickled_proguard_name = self._jar_path + '-proguard.pickle' | 54 self._pickled_proguard_name = self._jar_path + '-proguard.pickle' |
55 self._test_methods = {} | 55 self._test_methods = {} |
56 if not self._GetCachedProguardData(): | 56 if not self._GetCachedProguardData(): |
57 self._GetProguardData() | 57 self._GetProguardData() |
58 | 58 |
59 def _GetCachedProguardData(self): | 59 def _GetCachedProguardData(self): |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 devices = device_utils.DeviceUtils.parallel(devices) | 222 devices = device_utils.DeviceUtils.parallel(devices) |
223 min_sdk_version = min(devices.build_version_sdk.pGet(None)) | 223 min_sdk_version = min(devices.build_version_sdk.pGet(None)) |
224 tests = [t for t in tests | 224 tests = [t for t in tests |
225 if self._IsTestValidForSdkRange(t, min_sdk_version)] | 225 if self._IsTestValidForSdkRange(t, min_sdk_version)] |
226 | 226 |
227 return tests | 227 return tests |
228 | 228 |
229 @staticmethod | 229 @staticmethod |
230 def IsHostDrivenTest(test): | 230 def IsHostDrivenTest(test): |
231 return 'pythonDrivenTests' in test | 231 return 'pythonDrivenTests' in test |
OLD | NEW |