| 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 logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import posixpath | 9 import posixpath |
| 10 import time | 10 import time |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 # Run the test. | 377 # Run the test. |
| 378 timeout = (self._test_instance.shard_timeout | 378 timeout = (self._test_instance.shard_timeout |
| 379 * self.GetTool(device).GetTimeoutScale()) | 379 * self.GetTool(device).GetTimeoutScale()) |
| 380 if self._test_instance.store_tombstones: | 380 if self._test_instance.store_tombstones: |
| 381 tombstones.ClearAllTombstones(device) | 381 tombstones.ClearAllTombstones(device) |
| 382 with device_temp_file.DeviceTempFile( | 382 with device_temp_file.DeviceTempFile( |
| 383 adb=device.adb, | 383 adb=device.adb, |
| 384 dir=self._delegate.ResultsDirectory(device), | 384 dir=self._delegate.ResultsDirectory(device), |
| 385 suffix='.xml') as device_tmp_results_file: | 385 suffix='.xml') as device_tmp_results_file: |
| 386 | 386 |
| 387 flags = self._test_instance.test_arguments or '' | 387 flags = list(self._test_instance.flags) |
| 388 if self._test_instance.enable_xml_result_parsing: | 388 if self._test_instance.enable_xml_result_parsing: |
| 389 flags += ' --gtest_output=xml:%s' % device_tmp_results_file.name | 389 flags.append('--gtest_output=xml:%s' % device_tmp_results_file.name) |
| 390 if self._test_instance.gtest_also_run_disabled_tests: | 390 |
| 391 flags += ' --gtest_also_run_disabled_tests' | 391 logging.info('flags:') |
| 392 for f in flags: |
| 393 logging.info(' %s', f) |
| 392 | 394 |
| 393 with contextlib_ext.Optional( | 395 with contextlib_ext.Optional( |
| 394 trace_event.trace(str(test)), | 396 trace_event.trace(str(test)), |
| 395 self._env.trace_output): | 397 self._env.trace_output): |
| 396 output = self._delegate.Run( | 398 output = self._delegate.Run( |
| 397 test, device, flags=flags, | 399 test, device, flags=' '.join(flags), |
| 398 timeout=timeout, retries=0) | 400 timeout=timeout, retries=0) |
| 399 | 401 |
| 400 if self._test_instance.enable_xml_result_parsing: | 402 if self._test_instance.enable_xml_result_parsing: |
| 401 gtest_xml = device.ReadFile( | 403 gtest_xml = device.ReadFile( |
| 402 device_tmp_results_file.name, | 404 device_tmp_results_file.name, |
| 403 as_root=True) | 405 as_root=True) |
| 404 | 406 |
| 405 for s in self._servers[str(device)]: | 407 for s in self._servers[str(device)]: |
| 406 s.Reset() | 408 s.Reset() |
| 407 if self._test_instance.app_files: | 409 if self._test_instance.app_files: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 @local_device_environment.handle_shard_failures | 448 @local_device_environment.handle_shard_failures |
| 447 @trace_event.traced | 449 @trace_event.traced |
| 448 def individual_device_tear_down(dev): | 450 def individual_device_tear_down(dev): |
| 449 for s in self._servers.get(str(dev), []): | 451 for s in self._servers.get(str(dev), []): |
| 450 s.TearDown() | 452 s.TearDown() |
| 451 | 453 |
| 452 tool = self.GetTool(dev) | 454 tool = self.GetTool(dev) |
| 453 tool.CleanUpEnvironment() | 455 tool.CleanUpEnvironment() |
| 454 | 456 |
| 455 self._env.parallel_devices.pMap(individual_device_tear_down) | 457 self._env.parallel_devices.pMap(individual_device_tear_down) |
| OLD | NEW |