> CoveragePoints =
+ getFileLines(getCoveragePoints(ClBinaryName));
+
+ std::string Title = stripPathPrefix(ClBinaryName) + " Coverage Report";
+
+ OS << "\n";
+ OS << "\n";
+
+ // Stylesheet
+ OS << "\n";
+ OS << "" << Title << "\n";
+ OS << "\n";
+ OS << "\n";
+
+ // Title
+ OS << "" << Title << "
\n";
+ OS << "Coverage files: ";
+ for (auto InputFile : ClInputFiles) {
+ llvm::sys::fs::file_status Status;
+ llvm::sys::fs::status(InputFile, Status);
+ OS << stripPathPrefix(InputFile) << " ("
+ << Status.getLastModificationTime().str() << ")";
+ }
+ OS << "
\n";
+
+ // TOC
+ OS << "\n";
+
+ // Source
+ for (auto It : CoveredFileLines) {
+ auto FileName = It.first;
+ auto Lines = It.second;
+ auto CovLines = CoveragePoints[FileName];
+
+ OS << " \n";
+ OS << "" << stripPathPrefix(FileName) << "
\n";
+ ErrorOr> BufOrErr =
+ MemoryBuffer::getFile(FileName);
+ if (!BufOrErr) {
+ OS << "Error reading file: " << FileName << " : "
+ << BufOrErr.getError().message() << "("
+ << BufOrErr.getError().value() << ")\n";
+ continue;
+ }
+
+ OS << "\n";
+ for (line_iterator I = line_iterator(*BufOrErr.get(), false);
+ !I.is_at_eof(); ++I) {
+ OS << "";
+ OS << escapeHtml(*I) << "\n";
+ }
+ OS << "
\n";
+ }
+
+ OS << "\n";
+ OS << "\n";
+ }
+
// Print list of covered functions.
// Line format: :
void printCoveredFunctions(raw_ostream &OS) {
@@ -527,6 +661,10 @@
CovData.get()->printNotCoveredFunctions(outs());
return 0;
}
+ case HtmlReportAction: {
+ CovData.get()->printReport(outs());
+ return 0;
+ }
}
llvm_unreachable("unsupported action");