diff options
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp index e45c6f4..f7826e4 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -116,24 +116,39 @@ table { background: #ffffff; border: 1px solid #dbdbdb; } +.light-row-bold { + background: #ffffff; + border: 1px solid #dbdbdb; + font-weight: bold; +} .column-entry { - text-align: right; + text-align: left; } -.column-entry-left { +.column-entry-bold { + font-weight: bold; text-align: left; } .column-entry-yellow { - text-align: right; + text-align: left; background-color: #ffffd0; } +.column-entry-yellow:hover { + background-color: #fffff0; +} .column-entry-red { - text-align: right; + text-align: left; background-color: #ffd0d0; } +.column-entry-red:hover { + background-color: #fff0f0; +} .column-entry-green { - text-align: right; + text-align: left; background-color: #d0ffd0; } +.column-entry-green:hover { + background-color: #f0fff0; +} .line-number { text-align: right; color: #aaa; @@ -184,10 +199,11 @@ table { } th, td { vertical-align: top; - padding: 2px 5px; + padding: 2px 8px; border-collapse: collapse; border-right: solid 1px #eee; border-left: solid 1px #eee; + text-align: left; } td:first-child { border-left: none; @@ -195,6 +211,9 @@ td:first-child { td:last-child { border-right: none; } +tr:hover { + background-color: #f0f0f0; +} )"; const char *EndHeader = "</head>"; @@ -287,13 +306,14 @@ void CoveragePrinterHTML::closeViewFile(OwnedStream OS) { static void emitColumnLabelsForIndex(raw_ostream &OS, const CoverageViewOptions &Opts) { SmallVector<std::string, 4> Columns; - Columns.emplace_back(tag("td", "Filename", "column-entry-left")); - Columns.emplace_back(tag("td", "Function Coverage", "column-entry")); + Columns.emplace_back(tag("td", "Filename", "column-entry-bold")); + Columns.emplace_back(tag("td", "Function Coverage", "column-entry-bold")); if (Opts.ShowInstantiationSummary) - Columns.emplace_back(tag("td", "Instantiation Coverage", "column-entry")); - Columns.emplace_back(tag("td", "Line Coverage", "column-entry")); + Columns.emplace_back( + tag("td", "Instantiation Coverage", "column-entry-bold")); + Columns.emplace_back(tag("td", "Line Coverage", "column-entry-bold")); if (Opts.ShowRegionSummary) - Columns.emplace_back(tag("td", "Region Coverage", "column-entry")); + Columns.emplace_back(tag("td", "Region Coverage", "column-entry-bold")); OS << tag("tr", join(Columns.begin(), Columns.end(), "")); } @@ -323,7 +343,7 @@ void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF, { raw_string_ostream RSO{S}; if (Total) - RSO << format("%*.2f", 7, Pctg) << "% "; + RSO << format("%6.2f", 7, Pctg) << "% "; else RSO << "- "; RSO << '(' << Hit << '/' << Total << ')'; @@ -339,7 +359,7 @@ void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF, // Simplify the display file path, and wrap it in a link if requested. std::string Filename; if (IsTotals) { - Filename = "TOTALS"; + Filename = SF; } else { Filename = buildLinkToFile(SF, FCS); } @@ -360,7 +380,10 @@ void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF, FCS.RegionCoverage.getNumRegions(), FCS.RegionCoverage.getPercentCovered()); - OS << tag("tr", join(Columns.begin(), Columns.end(), ""), "light-row"); + if (IsTotals) + OS << tag("tr", join(Columns.begin(), Columns.end(), ""), "light-row-bold"); + else + OS << tag("tr", join(Columns.begin(), Columns.end(), ""), "light-row"); } Error CoveragePrinterHTML::createIndexFile( |