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

Unified Diff: build/android/pylib/remote/device/remote_device_gtest_run.py

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/remote/device/remote_device_gtest_run.py
diff --git a/build/android/pylib/remote/device/remote_device_gtest_run.py b/build/android/pylib/remote/device/remote_device_gtest_run.py
index fa8d5f9f21fe3a5764c672e0b97e91cb3019d8c7..ca233f1023a8cbbb0ecdcb08cfded1898b51d5c4 100644
--- a/build/android/pylib/remote/device/remote_device_gtest_run.py
+++ b/build/android/pylib/remote/device/remote_device_gtest_run.py
@@ -10,15 +10,10 @@ import sys
from pylib import constants
from pylib.base import base_test_result
+from pylib.remote.device import appurify_sanitized
from pylib.remote.device import remote_device_test_run
from pylib.remote.device import remote_device_helper
-sys.path.append(os.path.join(
- constants.DIR_SOURCE_ROOT, 'third_party', 'requests', 'src'))
-sys.path.append(os.path.join(
- constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src'))
-import appurify.api
-import appurify.utils
class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun):
"""Run gtests and uirobot tests on a remote device."""
@@ -27,12 +22,14 @@ class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun):
DEFAULT_RUNNER_PACKAGE = (
'org.chromium.native_test.ChromiumNativeTestInstrumentationTestRunner')
+ #override
def TestPackage(self):
- pass
+ return self._test_instance.suite
#override
def _TriggerSetUp(self):
"""Set up the triggering of a test run."""
+ logging.info('Triggering test run.')
self._app_id = self._UploadAppToDevice(self._test_instance.apk)
if not self._env.runner_type:
@@ -52,8 +49,15 @@ class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun):
config_body = {'runner': runner_package}
self._SetTestConfig(runner_type, config_body)
+ _INSTRUMENTATION_STREAM_LEADER = 'INSTRUMENTATION_STATUS: stream='
+
#override
def _ParseTestResults(self):
- # TODO(rnephew): Populate test results object.
+ logging.info('Parsing results from stdout.')
+ output = self._results['results']['output'].splitlines()
+ output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output
+ if l.startswith(self._INSTRUMENTATION_STREAM_LEADER))
+ results_list = self._test_instance.ParseGTestOutput(output)
results = base_test_result.TestRunResults()
+ results.AddResults(results_list)
return results

Powered by Google App Engine
This is Rietveld 408576698