[PATCH] D146010: [sancov] fix coverage-report-server cannot display coverage detail
Congcong Cai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 19 06:10:52 PDT 2023
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfb066c4622c8: [sancov] fix coverage-report-server cannot display coverage detail (authored by HerrCai0907).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146010/new/
https://reviews.llvm.org/D146010
Files:
llvm/tools/sancov/coverage-report-server.py
Index: llvm/tools/sancov/coverage-report-server.py
===================================================================
--- llvm/tools/sancov/coverage-report-server.py
+++ llvm/tools/sancov/coverage-report-server.py
@@ -71,6 +71,8 @@
</html>
"""
+FILE_URI_PREFIX = "/file/"
+
class SymcovData:
def __init__(self, symcov_json):
self.covered_points = frozenset(symcov_json['covered-points'])
@@ -129,7 +131,7 @@
src_path = None
def do_GET(self):
- norm_path = os.path.normpath(urllib.parse.unquote(self.path[1:]))
+ norm_path = os.path.normpath(urllib.parse.unquote(self.path[len(FILE_URI_PREFIX):]))
if self.path == '/':
self.send_response(200)
self.send_header("Content-type", "text/html; charset=utf-8")
@@ -141,8 +143,9 @@
if not file_coverage:
continue
filelist.append(
- "<tr><td><a href=\"./{name}\">{name}</a></td>"
+ "<tr><td><a href=\"{prefix}{name}\">{name}</a></td>"
"<td>{coverage}%</td></tr>".format(
+ prefix=FILE_URI_PREFIX,
name=html.escape(filename, quote=True),
coverage=format_pct(file_coverage)))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146010.506383.patch
Type: text/x-patch
Size: 1309 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230319/a38d2e72/attachment.bin>
More information about the llvm-commits
mailing list