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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 if tests: | 309 if tests: |
310 return tests | 310 return tests |
311 | 311 |
312 # Even when there's only one device, it still makes sense to retrieve the | 312 # Even when there's only one device, it still makes sense to retrieve the |
313 # test list so that tests can be split up and run in batches rather than all | 313 # test list so that tests can be split up and run in batches rather than all |
314 # at once (since test output is not streamed). | 314 # at once (since test output is not streamed). |
315 @local_device_test_run.handle_shard_failures_with( | 315 @local_device_test_run.handle_shard_failures_with( |
316 on_failure=self._env.BlacklistDevice) | 316 on_failure=self._env.BlacklistDevice) |
317 def list_tests(dev): | 317 def list_tests(dev): |
318 tests = self._delegate.Run( | 318 tests = self._delegate.Run( |
319 None, dev, flags='--gtest_list_tests', timeout=10) | 319 None, dev, flags='--gtest_list_tests', timeout=20) |
320 tests = gtest_test_instance.ParseGTestListTests(tests) | 320 tests = gtest_test_instance.ParseGTestListTests(tests) |
321 tests = self._test_instance.FilterTests(tests) | 321 tests = self._test_instance.FilterTests(tests) |
322 return tests | 322 return tests |
323 | 323 |
324 # Query all devices in case one fails. | 324 # Query all devices in case one fails. |
325 test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None) | 325 test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None) |
326 # TODO(agrieve): Make this fail rather than return an empty list when | 326 # TODO(agrieve): Make this fail rather than return an empty list when |
327 # all devices fail. | 327 # all devices fail. |
328 return list(sorted(set().union(*[set(tl) for tl in test_lists if tl]))) | 328 return list(sorted(set().union(*[set(tl) for tl in test_lists if tl]))) |
329 | 329 |
(...skipping 24 matching lines...) Expand all 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 |