Index: test/tools/llvm-cov/showLineExecutionCounts.cpp =================================================================== --- test/tools/llvm-cov/showLineExecutionCounts.cpp +++ test/tools/llvm-cov/showLineExecutionCounts.cpp @@ -77,11 +77,12 @@ // TEXT-INDEX-NEXT: {{.*}}showLineExecutionCounts.cpp // // RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s -// HTML-INDEX-LABEL: -// HTML-INDEX: -// HTML-INDEX: -// HTML-INDEX: -// HTML-INDEX: +// HTML-INDEX:
FilenameFunction CoverageLine CoverageRegion Coverage
+// HTML-INDEX: +// HTML-INDEX: +// HTML-INDEX: +// HTML-INDEX: // HTML-INDEX: // HTML-INDEX:
FilenameFunction CoverageLine CoverageRegion Coverage // HTML-INDEX: 100.00% (1/1) @@ -90,3 +91,6 @@ // HTML-INDEX: // HTML-INDEX: 70.00% (7/10) // HTML-INDEX: TOTALS +// HTML-INDEX: +)"; + std::string getPathToStyle(StringRef ViewPath) { std::string PathToStyle = ""; std::string PathSep = sys::path::get_separator(); @@ -256,7 +334,7 @@ void emitEpilog(raw_ostream &OS) { OS << "" - << ""; + << "" << JSForCoverage; } } // anonymous namespace @@ -283,12 +361,25 @@ emitEpilog(*OS.get()); } +/// Emit filter input for the table in the index. +void renderFilterInputHTML(raw_ostream &OS) { + std::string FilterLabel = "Filter: "; + OS << tag("h5", tag("label", FilterLabel)); +} + /// Emit column labels for the table in the index. static void emitColumnLabelsForIndex(raw_ostream &OS) { SmallVector Columns; - Columns.emplace_back(tag("td", "Filename", "column-entry-left")); - for (const char *Label : - {"Function Coverage", "Line Coverage", "Region Coverage"}) + std::string SortFilename = + "Filename"; + Columns.emplace_back(tag("td", SortFilename, "column-entry-left")); + for ( + const char *Label : + {"Function " + "Coverage", + "Line Coverage", + "Region Coverage"}) Columns.emplace_back(tag("td", Label, "column-entry")); OS << tag("tr", join(Columns.begin(), Columns.end(), "")); } @@ -372,6 +463,8 @@ if (Opts.hasCreatedTime()) OSRef << tag(CreatedTimeTag, escape(Opts.CreatedTimeStr, Opts)); + renderFilterInputHTML(OSRef); + // Emit a table containing links to reports for each file in the covmapping. CoverageReport Report(Opts, Coverage); OSRef << BeginCenteredDiv << BeginTable;