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

Unified Diff: tools/testrunner/local/execution.py

Issue 1737263003: [coverage] Enable sanitizer coverage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Logging + exe blacklist Created 4 years, 9 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
« no previous file with comments | « tools/testrunner/local/commands.py ('k') | tools/testrunner/objects/context.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/local/execution.py
diff --git a/tools/testrunner/local/execution.py b/tools/testrunner/local/execution.py
index 06e8037fc803e84e864aedb6bfa11ba137477de3..090f31f5cda02f046cfb7a86d39dccfc052364cd 100644
--- a/tools/testrunner/local/execution.py
+++ b/tools/testrunner/local/execution.py
@@ -144,6 +144,26 @@ class TestJob(Job):
def __init__(self, test):
self.test = test
+ def _rename_coverage_data(self, output, context):
+ """Rename coverage data.
+
+ Rename files with PIDs to files with unique test IDs, because the number
+ of tests might be higher than pid_max. E.g.:
+ d8.1234.sancov -> d8.test.1.sancov, where 1234 was the process' PID
+ and 1 is the test ID.
+ """
+ if context.sancov_dir:
+ sancov_file = os.path.join(
+ context.sancov_dir, "%s.%d.sancov" % (self.test.shell(), output.pid))
+
+ # Some tests are expected to fail and don't produce coverage data.
+ if os.path.exists(sancov_file):
+ parts = sancov_file.split(".")
+ new_sancov_file = ".".join(
+ parts[:-2] + ["test", str(self.test.id)] + parts[-1:])
+ assert not os.path.exists(new_sancov_file)
+ os.rename(sancov_file, new_sancov_file)
+
def Run(self, process_context):
try:
# Retrieve a new suite object on the worker-process side. The original
@@ -155,6 +175,7 @@ class TestJob(Job):
start_time = time.time()
output = commands.Execute(instr.command, instr.verbose, instr.timeout)
+ self._rename_coverage_data(output, process_context.context)
return (instr.id, output, time.time() - start_time)
« no previous file with comments | « tools/testrunner/local/commands.py ('k') | tools/testrunner/objects/context.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698