Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: build/android/pylib/local/device/local_device_gtest_run.py

Issue 1416763003: [Android] Fix --test-arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 # TODO(agrieve): Make this fail rather than return an empty list when 293 # TODO(agrieve): Make this fail rather than return an empty list when
294 # all devices fail. 294 # all devices fail.
295 return list(sorted(set().union(*[set(tl) for tl in test_lists if tl]))) 295 return list(sorted(set().union(*[set(tl) for tl in test_lists if tl])))
296 296
297 #override 297 #override
298 def _RunTest(self, device, test): 298 def _RunTest(self, device, test):
299 # Run the test. 299 # Run the test.
300 timeout = (self._test_instance.shard_timeout 300 timeout = (self._test_instance.shard_timeout
301 * self.GetTool(device).GetTimeoutScale()) 301 * self.GetTool(device).GetTimeoutScale())
302 output = self._delegate.Run( 302 output = self._delegate.Run(
303 test, device, timeout=timeout, retries=0) 303 test, device, flags=self._test_instance.test_arguments,
304 timeout=timeout, retries=0)
304 for s in self._servers[str(device)]: 305 for s in self._servers[str(device)]:
305 s.Reset() 306 s.Reset()
306 if self._test_instance.app_files: 307 if self._test_instance.app_files:
307 self._delegate.PullAppFiles(device, self._test_instance.app_files, 308 self._delegate.PullAppFiles(device, self._test_instance.app_files,
308 self._test_instance.app_file_dir) 309 self._test_instance.app_file_dir)
309 self._delegate.Clear(device) 310 self._delegate.Clear(device)
310 311
311 # Parse the output. 312 # Parse the output.
312 # TODO(jbudorick): Transition test scripts away from parsing stdout. 313 # TODO(jbudorick): Transition test scripts away from parsing stdout.
313 results = self._test_instance.ParseGTestOutput(output) 314 results = self._test_instance.ParseGTestOutput(output)
314 return results 315 return results
315 316
316 #override 317 #override
317 def TearDown(self): 318 def TearDown(self):
318 @local_device_test_run.handle_shard_failures 319 @local_device_test_run.handle_shard_failures
319 def individual_device_tear_down(dev): 320 def individual_device_tear_down(dev):
320 for s in self._servers.get(str(dev), []): 321 for s in self._servers.get(str(dev), []):
321 s.TearDown() 322 s.TearDown()
322 323
323 tool = self.GetTool(dev) 324 tool = self.GetTool(dev)
324 tool.CleanUpEnvironment() 325 tool.CleanUpEnvironment()
325 326
326 self._env.parallel_devices.pMap(individual_device_tear_down) 327 self._env.parallel_devices.pMap(individual_device_tear_down)
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/gtest_test_instance.py ('k') | build/android/pylib/remote/device/remote_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698