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

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

Issue 1964183003: Fixed coverage dir for instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 7 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_instrumentation_test_run.py
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
index 2d574de1fd2017149062cb63c9c4eb12e6023bad..30118cf678489e346bbf62806ac710c8ffaf9bda 100644
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import logging
+import os
import re
import time
@@ -186,6 +187,16 @@ class LocalDeviceInstrumentationTestRun(
flags = None
test_timeout_scale = None
+ if self._test_instance.coverage_directory:
+ coverage_basename = '%s.ec' % ('%s_group' % test[0]['method']
+ if isinstance(test, list) else test['method'])
+ extras['coverage'] = 'true'
+ coverage_directory = os.path.join(
+ device.GetExternalStoragePath(), 'chrome', 'test', 'coverage')
+ coverage_device_file = os.path.join(
+ coverage_directory, coverage_basename)
+ extras['coverageFile'] = coverage_device_file
+
if isinstance(test, list):
if not self._test_instance.driver_apk:
raise Exception('driver_apk does not exist. '
@@ -279,7 +290,11 @@ class LocalDeviceInstrumentationTestRun(
logging.debug('raw output from %s:', test_display_name)
for l in output:
logging.debug(' %s', l)
-
+ if self._test_instance.coverage_directory:
+ device.PullFile(coverage_directory,
+ self._test_instance.coverage_directory)
+ device.RunShellCommand('rm -f %s' % os.path.join(coverage_directory,
+ '*'))
return results
#override

Powered by Google App Engine
This is Rietveld 408576698