// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence %s | FileCheck -check-prefixes=TEXT-TITLE,TEXT,TEXT-FILE,TEXT-HEADER %s
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -name=main -filename-equivalence %s | FileCheck -check-prefixes=TEXT-FUNCTION,TEXT-HEADER %s
// TEXT-TITLE: Test Suite
-// TEXT: Code Coverage Report
+// TEXT: Coverage Report
// TEXT: Created:
// TEXT-FILE: showProjectSummary.cpp:
// TEXT-FILE: showProjectSummary.covmapping:
// RUN: FileCheck -check-prefixes=HTML-TITLE,HTML -input-file %t.dir/index.html %s
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence -name=main %s
// RUN: FileCheck -check-prefixes=HTML-FUNCTION,HTML-HEADER -input-file %t.dir/functions.html %s
-// HTML-TITLE: <div class='project-title'>
-// HTML-TITLE: <span>Test Suite</span>
-// HTML: <div class='report-title'>
-// HTML: <span>Code Coverage Report</span>
-// HTML: <div class='created-time'>
-// HTML: <span>Created:
-// HTML-FILE: <pre>Source: {{.*}}showProjectSummary.cpp (Binary: showProjectSummary.covmapping)</pre>
+// HTML-TITLE: <h1>Test Suite</h1>
+// HTML: <h2>Coverage Report</h2>
+// HTML: <h4>Created:{{.*}}</h4>
+// HTML-FILE: <pre>{{.*}}showProjectSummary.cpp (Binary: showProjectSummary.covmapping)</pre>
// HTML-FUNCTION: <pre>main</pre>
// HTML-UNCOVEREDLINE: <a href='#L8'>Go to first unexecuted line</a>
// HTML-HEADER: <tr><td><span><pre>Line No.</pre></span></td>
.column-entry {
text-align: right;
}
+.column-entry-left {
+ text-align: left;
+}
.column-entry-yellow {
text-align: right;
background-color: #ffffd0;
td:last-child {
border-right: none;
}
-.project-title {
- font-size:36.0pt;
- line-height:200%;
- font-family:Calibri;
- font-weight: bold;
-}
-.report-title {
- font-size:16.0pt;
- line-height:120%;
- font-family:Arial;
- font-weight: bold;
-}
-.created-time {
- font-size:14.0pt;
- line-height:120%;
- font-family:Arial;
-}
)";
const char *EndHeader = "</head>";
const char *EndTable = "</table>";
-const char *BeginProjectTitleDiv = "<div class='project-title'>";
-
-const char *EndProjectTitleDiv = "</div>";
-
-const char *BeginReportTitleDiv = "<div class='report-title'>";
-
-const char *EndReportTitleDiv = "</div>";
-
-const char *BeginCreatedTimeDiv = "<div class='created-time'>";
+const char *ProjectTitleTag = "h1";
-const char *EndCreatedTimeDiv = "</div>";
+const char *ReportTitleTag = "h2";
-const char *LineBreak = "<br>";
+const char *CreatedTimeTag = "h4";
std::string getPathToStyle(StringRef ViewPath) {
std::string PathToStyle = "";
/// Emit column labels for the table in the index.
static void emitColumnLabelsForIndex(raw_ostream &OS) {
SmallVector<std::string, 4> Columns;
+ Columns.emplace_back(tag("td", "Filename", "column-entry-left"));
for (const char *Label :
- {"Filename", "Region Coverage", "Function Coverage", "Line Coverage"})
+ {"Function Coverage", "Line Coverage", "Region Coverage"})
Columns.emplace_back(tag("td", Label, "column-entry"));
OS << tag("tr", join(Columns.begin(), Columns.end(), ""));
}
CellClass = "column-entry-red";
else if (Hit == Total)
CellClass = "column-entry-green";
- Columns.emplace_back(tag("td", tag("pre", S, "code"), CellClass));
+ Columns.emplace_back(tag("td", tag("pre", S), CellClass));
};
// Simplify the display file path, and wrap it in a link if requested.
Filename = a(LinkTarget, LinkText);
}
- Columns.emplace_back(tag("td", tag("pre", Filename, "code")));
- AddCoverageTripleToColumn(
- FCS.RegionCoverage.NumRegions - FCS.RegionCoverage.NotCovered,
- FCS.RegionCoverage.NumRegions, FCS.RegionCoverage.getPercentCovered());
+ Columns.emplace_back(tag("td", tag("pre", Filename)));
AddCoverageTripleToColumn(FCS.FunctionCoverage.Executed,
FCS.FunctionCoverage.NumFunctions,
FCS.FunctionCoverage.getPercentCovered());
AddCoverageTripleToColumn(
FCS.LineCoverage.NumLines - FCS.LineCoverage.NotCovered,
FCS.LineCoverage.NumLines, FCS.LineCoverage.getPercentCovered());
+ AddCoverageTripleToColumn(
+ FCS.RegionCoverage.NumRegions - FCS.RegionCoverage.NotCovered,
+ FCS.RegionCoverage.NumRegions, FCS.RegionCoverage.getPercentCovered());
OS << tag("tr", join(Columns.begin(), Columns.end(), ""), "light-row");
}
// Emit some basic information about the coverage report.
if (Opts.hasProjectTitle())
- OSRef << BeginProjectTitleDiv
- << tag("span", escape(Opts.ProjectTitle, Opts)) << EndProjectTitleDiv;
- OSRef << BeginReportTitleDiv
- << tag("span", escape("Code Coverage Report", Opts))
- << EndReportTitleDiv;
+ OSRef << tag(ProjectTitleTag, escape(Opts.ProjectTitle, Opts));
+ OSRef << tag(ReportTitleTag, "Coverage Report");
if (Opts.hasCreatedTime())
- OSRef << BeginCreatedTimeDiv
- << tag("span", escape(Opts.CreatedTimeStr, Opts))
- << EndCreatedTimeDiv;
- OSRef << LineBreak;
+ OSRef << tag(CreatedTimeTag, escape(Opts.CreatedTimeStr, Opts));
// Emit a table containing links to reports for each file in the covmapping.
CoverageReport Report(Opts, Coverage);
}
void SourceCoverageViewHTML::renderViewHeader(raw_ostream &OS) {
- OS << LineBreak << BeginCenteredDiv << BeginTable;
+ OS << BeginCenteredDiv << BeginTable;
}
void SourceCoverageViewHTML::renderViewFooter(raw_ostream &OS) {
void SourceCoverageViewHTML::renderCellInTitle(raw_ostream &OS,
StringRef CellText) {
if (getOptions().hasProjectTitle())
- OS << BeginProjectTitleDiv
- << tag("span", escape(getOptions().ProjectTitle, getOptions()))
- << EndProjectTitleDiv;
-
- OS << BeginReportTitleDiv << tag("span", escape(CellText, getOptions()))
- << EndReportTitleDiv;
-
+ OS << tag(ProjectTitleTag, escape(getOptions().ProjectTitle, getOptions()));
+ OS << tag(ReportTitleTag, escape(CellText, getOptions()));
if (getOptions().hasCreatedTime())
- OS << BeginCreatedTimeDiv
- << tag("span", escape(getOptions().CreatedTimeStr, getOptions()))
- << EndCreatedTimeDiv;
+ OS << tag(CreatedTimeTag,
+ escape(getOptions().CreatedTimeStr, getOptions()));
}
void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS,