From: Maxim Ostapenko Date: Mon, 20 Mar 2017 14:06:04 +0000 (+0000) Subject: [sancov] Fix broken links and displaced coloring in coverage-report-server.py X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a525a2ba75aa810777971aebf12be2eb875f0f6c;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/llvm/tools/sancov/coverage-report-server.py b/llvm/tools/sancov/coverage-report-server.py index ac3206c..428276f 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( - "{name}" + "{name}" "{coverage}%".format( name=html.escape(filename, quote=True), coverage=format_pct(file_coverage))) @@ -165,7 +165,7 @@ class ServerHandler(http.server.BaseHTTPRequestHandler): ["{line} ".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:],