| 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 fnmatch | 5 import fnmatch |
| 6 import functools | 6 import functools |
| 7 import imp | 7 import imp |
| 8 import logging | 8 import logging |
| 9 | 9 |
| 10 from devil import base_error | 10 from devil import base_error |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 all_test_results = {r.GetName(): r for r in try_results.GetAll()} | 155 all_test_results = {r.GetName(): r for r in try_results.GetAll()} |
| 156 | 156 |
| 157 def should_retry(name): | 157 def should_retry(name): |
| 158 # When specifying a test filter, names can contain trailing wildcards. | 158 # When specifying a test filter, names can contain trailing wildcards. |
| 159 # See local_device_gtest_run._ExtractTestsFromFilter() | 159 # See local_device_gtest_run._ExtractTestsFromFilter() |
| 160 if name.endswith('*'): | 160 if name.endswith('*'): |
| 161 return any(fnmatch.fnmatch(n, name) and is_failure(t) | 161 return any(fnmatch.fnmatch(n, name) and is_failure(t) |
| 162 for n, t in all_test_results.iteritems()) | 162 for n, t in all_test_results.iteritems()) |
| 163 return is_failure(all_test_results.get(name)) | 163 return is_failure(all_test_results.get(name)) |
| 164 | 164 |
| 165 return [t for t in tests if should_retry(self._GetTestName(t))] | 165 return [t for t in tests if should_retry(self._GetUniqueTestName(t))] |
| 166 | 166 |
| 167 def GetTool(self, device): | 167 def GetTool(self, device): |
| 168 if not str(device) in self._tools: | 168 if not str(device) in self._tools: |
| 169 self._tools[str(device)] = valgrind_tools.CreateTool( | 169 self._tools[str(device)] = valgrind_tools.CreateTool( |
| 170 self._env.tool, device) | 170 self._env.tool, device) |
| 171 return self._tools[str(device)] | 171 return self._tools[str(device)] |
| 172 | 172 |
| 173 def _CreateShards(self, tests): | 173 def _CreateShards(self, tests): |
| 174 raise NotImplementedError | 174 raise NotImplementedError |
| 175 | 175 |
| 176 # pylint: disable=no-self-use | 176 # pylint: disable=no-self-use |
| 177 def _GetTestName(self, test): | 177 def _GetUniqueTestName(self, test): |
| 178 return test | 178 return test |
| 179 | 179 |
| 180 def _GetTests(self): | 180 def _GetTests(self): |
| 181 raise NotImplementedError | 181 raise NotImplementedError |
| 182 | 182 |
| 183 def _RunTest(self, device, test): | 183 def _RunTest(self, device, test): |
| 184 raise NotImplementedError | 184 raise NotImplementedError |
| 185 | 185 |
| 186 def _ShouldShard(self): | 186 def _ShouldShard(self): |
| 187 raise NotImplementedError | 187 raise NotImplementedError |
| OLD | NEW |