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

Unified Diff: build/android/pylib/local/device/local_device_test_run.py

Issue 1363643002: [Android] Fix miscellaneous small issues with gtest platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on blink Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/local/device/local_device_test_run.py
diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py
index db19fe30d5104bfe1873875c6fdd4dd4af745795..b9d2f0020bc489705a5802616cf22c7a308346c8 100644
--- a/build/android/pylib/local/device/local_device_test_run.py
+++ b/build/android/pylib/local/device/local_device_test_run.py
@@ -29,6 +29,7 @@ def handle_shard_failures(f):
logging.exception('Shard died: %s(%s)', f.__name__, str(dev))
return None
+ wrapper.__name__ = f.__name__
return wrapper
@@ -42,25 +43,32 @@ class LocalDeviceTestRun(test_run.TestRun):
def RunTests(self):
tests = self._GetTests()
+ def run_test(dev, test):
+ try:
+ return self._RunTest(dev, test)
+ except device_errors.CommandFailedError:
+ logging.exception('Test failed: %s', test)
+ except device_errors.CommandTimeoutError:
+ logging.exception('Test timed out: %s', test)
+ return None
+
@handle_shard_failures
def run_tests_on_device(dev, tests, results):
for test in tests:
+ result = None
try:
- result = self._RunTest(dev, test)
- if isinstance(result, base_test_result.BaseTestResult):
- results.AddResult(result)
- elif isinstance(result, list):
- results.AddResults(result)
- else:
- raise Exception(
- 'Unexpected result type: %s' % type(result).__name__)
- except:
- if isinstance(tests, test_collection.TestCollection):
- tests.add(test)
- raise
+ result = run_test(dev, test)
finally:
if isinstance(tests, test_collection.TestCollection):
+ if not result:
+ tests.add(test)
tests.test_completed()
+
+ if isinstance(result, base_test_result.BaseTestResult):
+ results.AddResult(result)
+ elif isinstance(result, list):
+ results.AddResults(result)
+
logging.info('Finished running tests on this device.')
tries = 0

Powered by Google App Engine
This is Rietveld 408576698