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 collections | 5 import collections |
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 timeout = (self._test_instance.shard_timeout | 332 timeout = (self._test_instance.shard_timeout |
333 * self.GetTool(device).GetTimeoutScale()) | 333 * self.GetTool(device).GetTimeoutScale()) |
334 output = self._delegate.Run( | 334 output = self._delegate.Run( |
335 test, device, flags=self._test_instance.test_arguments, | 335 test, device, flags=self._test_instance.test_arguments, |
336 timeout=timeout, retries=0) | 336 timeout=timeout, retries=0) |
337 for s in self._servers[str(device)]: | 337 for s in self._servers[str(device)]: |
338 s.Reset() | 338 s.Reset() |
339 if self._test_instance.app_files: | 339 if self._test_instance.app_files: |
340 self._delegate.PullAppFiles(device, self._test_instance.app_files, | 340 self._delegate.PullAppFiles(device, self._test_instance.app_files, |
341 self._test_instance.app_file_dir) | 341 self._test_instance.app_file_dir) |
342 if not self._test_instance.skip_clear_data: | 342 if not self._env.skip_clear_data: |
343 self._delegate.Clear(device) | 343 self._delegate.Clear(device) |
344 | 344 |
345 # Parse the output. | 345 # Parse the output. |
346 # TODO(jbudorick): Transition test scripts away from parsing stdout. | 346 # TODO(jbudorick): Transition test scripts away from parsing stdout. |
347 results = self._test_instance.ParseGTestOutput(output) | 347 results = self._test_instance.ParseGTestOutput(output) |
348 | 348 |
349 # Check whether there are any crashed testcases. | 349 # Check whether there are any crashed testcases. |
350 self._crashes.update(r.GetName() for r in results | 350 self._crashes.update(r.GetName() for r in results |
351 if r.GetType() == base_test_result.ResultType.CRASH) | 351 if r.GetType() == base_test_result.ResultType.CRASH) |
352 return results | 352 return results |
353 | 353 |
354 #override | 354 #override |
355 def TearDown(self): | 355 def TearDown(self): |
356 @local_device_test_run.handle_shard_failures | 356 @local_device_test_run.handle_shard_failures |
357 def individual_device_tear_down(dev): | 357 def individual_device_tear_down(dev): |
358 for s in self._servers.get(str(dev), []): | 358 for s in self._servers.get(str(dev), []): |
359 s.TearDown() | 359 s.TearDown() |
360 | 360 |
361 tool = self.GetTool(dev) | 361 tool = self.GetTool(dev) |
362 tool.CleanUpEnvironment() | 362 tool.CleanUpEnvironment() |
363 | 363 |
364 self._env.parallel_devices.pMap(individual_device_tear_down) | 364 self._env.parallel_devices.pMap(individual_device_tear_down) |
OLD | NEW |