summaryrefslogtreecommitdiffstats
path: root/llvm/tools/sancov/coverage-report-server.py
diff options
context:
space:
mode:
authorMaxim Ostapenko <chefmax7@gmail.com>2017-03-20 14:06:04 +0000
committerMaxim Ostapenko <chefmax7@gmail.com>2017-03-20 14:06:04 +0000
commita525a2ba75aa810777971aebf12be2eb875f0f6c (patch)
tree32a77c0b00fb715b5bf8bae2445a9dc9f41e6a58 /llvm/tools/sancov/coverage-report-server.py
parent610ad9b53f81807ef3ed595c7f80b409ac10a3d6 (diff)
downloadbcm5719-llvm-a525a2ba75aa810777971aebf12be2eb875f0f6c.tar.gz
bcm5719-llvm-a525a2ba75aa810777971aebf12be2eb875f0f6c.zip
[sancov] Fix broken links and displaced coloring in coverage-report-server.py
This patch fixes two issues: * Fixed relative links to source files * Enumeration of lines in source files starts from 1 instead of 0 to align with .symcov files generated by sancov -symbolize Patch by Dmitiriy Nikiforov. Differential Revision: https://reviews.llvm.org/D31038 llvm-svn: 298250
Diffstat (limited to 'llvm/tools/sancov/coverage-report-server.py')
-rwxr-xr-xllvm/tools/sancov/coverage-report-server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/sancov/coverage-report-server.py b/llvm/tools/sancov/coverage-report-server.py
index ac3206cba39..428276f95d3 100755
--- a/llvm/tools/sancov/coverage-report-server.py
+++ b/llvm/tools/sancov/coverage-report-server.py
@@ -138,7 +138,7 @@ class ServerHandler(http.server.BaseHTTPRequestHandler):
if not file_coverage:
continue
filelist.append(
- "<tr><td><a href=\"/{name}\">{name}</a></td>"
+ "<tr><td><a href=\"./{name}\">{name}</a></td>"
"<td>{coverage}%</td></tr>".format(
name=html.escape(filename, quote=True),
coverage=format_pct(file_coverage)))
@@ -165,7 +165,7 @@ class ServerHandler(http.server.BaseHTTPRequestHandler):
["<span class='{cls}'>{line}&nbsp;</span>".format(
line=html.escape(line.rstrip()),
cls=linemap.get(line_no, ""))
- for line_no, line in enumerate(f)])
+ for line_no, line in enumerate(f, start=1)])
response = string.Template(CONTENT_PAGE_TMPL).safe_substitute(
path=self.path[1:],
OpenPOWER on IntegriCloud