OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import imp | 5 import imp |
6 import itertools | 6 import itertools |
7 import os | 7 import os |
8 import posixpath | 8 import posixpath |
9 | 9 |
10 from devil.android import device_errors | 10 from devil.android import device_errors |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 # wildcard comes at the end and there is at least one . to prove the scope is | 84 # wildcard comes at the end and there is at least one . to prove the scope is |
85 # not too large. | 85 # not too large. |
86 # This heuristic is not necessarily faster, but normally is. | 86 # This heuristic is not necessarily faster, but normally is. |
87 if len(patterns) == 1 and patterns[0].endswith('*'): | 87 if len(patterns) == 1 and patterns[0].endswith('*'): |
88 no_suffix = patterns[0].rstrip('*') | 88 no_suffix = patterns[0].rstrip('*') |
89 if '*' not in no_suffix and '.' in no_suffix: | 89 if '*' not in no_suffix and '.' in no_suffix: |
90 return patterns | 90 return patterns |
91 | 91 |
92 if '*' in gtest_filter: | 92 if '*' in gtest_filter: |
93 return None | 93 return None |
94 return patterns | 94 return [p for p in patterns if p] # Ignore empty entries. |
95 | 95 |
96 | 96 |
97 class _ApkDelegate(object): | 97 class _ApkDelegate(object): |
98 def __init__(self, test_instance): | 98 def __init__(self, test_instance): |
99 self._activity = test_instance.activity | 99 self._activity = test_instance.activity |
100 self._apk_helper = test_instance.apk_helper | 100 self._apk_helper = test_instance.apk_helper |
101 self._package = test_instance.package | 101 self._package = test_instance.package |
102 self._runner = test_instance.runner | 102 self._runner = test_instance.runner |
103 self._permissions = test_instance.permissions | 103 self._permissions = test_instance.permissions |
104 self._suite = test_instance.suite | 104 self._suite = test_instance.suite |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 def TearDown(self): | 354 def TearDown(self): |
355 @local_device_test_run.handle_shard_failures | 355 @local_device_test_run.handle_shard_failures |
356 def individual_device_tear_down(dev): | 356 def individual_device_tear_down(dev): |
357 for s in self._servers.get(str(dev), []): | 357 for s in self._servers.get(str(dev), []): |
358 s.TearDown() | 358 s.TearDown() |
359 | 359 |
360 tool = self.GetTool(dev) | 360 tool = self.GetTool(dev) |
361 tool.CleanUpEnvironment() | 361 tool.CleanUpEnvironment() |
362 | 362 |
363 self._env.parallel_devices.pMap(individual_device_tear_down) | 363 self._env.parallel_devices.pMap(individual_device_tear_down) |
OLD | NEW |