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 | 6 |
7 import collections | 7 import collections |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import pickle | 10 import pickle |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 available_tests = list(set(available_tests) - set(excluded_tests)) | 202 available_tests = list(set(available_tests) - set(excluded_tests)) |
203 else: | 203 else: |
204 available_tests = [m for m in self.GetTestMethods() | 204 available_tests = [m for m in self.GetTestMethods() |
205 if not self.IsHostDrivenTest(m)] | 205 if not self.IsHostDrivenTest(m)] |
206 | 206 |
207 tests = [] | 207 tests = [] |
208 if test_filter: | 208 if test_filter: |
209 # |available_tests| are in adb instrument format: package.path.class#test. | 209 # |available_tests| are in adb instrument format: package.path.class#test. |
210 filter_without_hash = test_filter.replace('#', '.') | 210 filter_without_hash = test_filter.replace('#', '.') |
211 tests = [t for t in available_tests | 211 tests = [t for t in available_tests |
212 if filter_without_hash in t.replace('#', '.')] | 212 if re.search(filter_without_hash, t.replace('#', '.'))] |
frankf
2014/01/22 18:43:11
The test filter includes '.' in package names whic
| |
213 else: | 213 else: |
214 tests = available_tests | 214 tests = available_tests |
215 | 215 |
216 return tests | 216 return tests |
217 | 217 |
218 @staticmethod | 218 @staticmethod |
219 def IsHostDrivenTest(test): | 219 def IsHostDrivenTest(test): |
220 return 'pythonDrivenTests' in test | 220 return 'pythonDrivenTests' in test |
OLD | NEW |