Skip to content

Commit

Permalink
[sancov] Fix broken links and displaced coloring in coverage-report-s…
Browse files Browse the repository at this point in the history
…erver.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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298250 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chefmax7 committed Mar 20, 2017
1 parent e2c895b commit c94df81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/sancov/coverage-report-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def do_GET(self):
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)))
Expand All @@ -165,7 +165,7 @@ def do_GET(self):
["<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:],
Expand Down

0 comments on commit c94df81

Please sign in to comment.