Index: tools/llvm-cov/SourceCoverageViewHTML.cpp =================================================================== --- tools/llvm-cov/SourceCoverageViewHTML.cpp +++ tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -116,24 +116,39 @@ 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 @@ } 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:last-child { border-right: none; } +tr:hover { + background-color: #f0f0f0; +} )"; const char *EndHeader = ""; @@ -287,13 +306,14 @@ static void emitColumnLabelsForIndex(raw_ostream &OS, const CoverageViewOptions &Opts) { SmallVector 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 @@ { 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 @@ // 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 @@ 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(