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

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

Issue 2514943002: [Android] Clean up gtest stdout handling. (Closed)
Patch Set: write/update -> append/update Created 4 years, 1 month 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
« no previous file with comments | « no previous file | testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/local/device/local_device_gtest_run.py
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py
index 0971d228e065ca0943fdf38b20bf9be01a6e1ca7..e2c6a882e2fd1016b7d35cd3df0f3e1038ab5f72 100644
--- a/build/android/pylib/local/device/local_device_gtest_run.py
+++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -25,12 +25,15 @@ _EXTRA_COMMAND_LINE_FILE = (
'org.chromium.native_test.NativeTest.CommandLineFile')
_EXTRA_COMMAND_LINE_FLAGS = (
'org.chromium.native_test.NativeTest.CommandLineFlags')
-_EXTRA_TEST_LIST = (
+_EXTRA_STDOUT_FILE = (
'org.chromium.native_test.NativeTestInstrumentationTestRunner'
- '.TestList')
+ '.StdoutFile')
_EXTRA_TEST = (
'org.chromium.native_test.NativeTestInstrumentationTestRunner'
'.Test')
+_EXTRA_TEST_LIST = (
+ 'org.chromium.native_test.NativeTestInstrumentationTestRunner'
+ '.TestList')
_MAX_SHARD_SIZE = 256
_SECONDS_TO_NANOS = int(1e9)
@@ -153,13 +156,22 @@ class _ApkDelegate(object):
else:
extras[_EXTRA_TEST] = test[0]
- with command_line_file, test_list_file:
+ stdout_file = device_temp_file.DeviceTempFile(
+ device.adb, dir=device.GetExternalStoragePath(), suffix='.gtest_out')
+ extras[_EXTRA_STDOUT_FILE] = stdout_file.name
+
+ with command_line_file, test_list_file, stdout_file:
try:
- return device.StartInstrumentation(
+ device.StartInstrumentation(
self._component, extras=extras, raw=False, **kwargs)
+ except device_errors.CommandFailedError:
+ logging.exception('gtest shard failed.')
+ except device_errors.CommandTimeoutError:
+ logging.exception('gtest shard timed out.')
except Exception:
device.ForceStop(self._package)
raise
+ return device.ReadFile(stdout_file.name).splitlines()
def PullAppFiles(self, device, files, directory):
PullAppFilesImpl(device, self._package, files, directory)
« no previous file with comments | « no previous file | testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698