[llvm-cov] Add support for creating html reports

Based on a patch by Harlan Haskins!

Differential Revision: http://reviews.llvm.org/D18278

llvm-svn: 274688
This commit is contained in:
Vedant Kumar
2016-07-06 21:44:05 +00:00
parent d03e659140
commit 4c01092a25
9 changed files with 615 additions and 2 deletions

View File

@@ -272,6 +272,8 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
"format", cl::desc("Output format for line-based coverage reports"),
cl::values(clEnumValN(CoverageViewOptions::OutputFormat::Text, "text",
"Text output"),
clEnumValN(CoverageViewOptions::OutputFormat::HTML, "html",
"HTML output"),
clEnumValEnd),
cl::init(CoverageViewOptions::OutputFormat::Text));
@@ -333,6 +335,11 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
? sys::Process::StandardOutHasColors()
: UseColor == cl::BOU_TRUE;
break;
case CoverageViewOptions::OutputFormat::HTML:
if (UseColor == cl::BOU_FALSE)
error("Color output cannot be disabled when generating html.");
ViewOpts.Colors = true;
break;
}
// Create the function filters
@@ -527,6 +534,9 @@ int CodeCoverageTool::report(int argc, const char **argv,
if (Err)
return Err;
if (ViewOpts.Format == CoverageViewOptions::OutputFormat::HTML)
error("HTML output for summary reports is not yet supported.");
auto Coverage = load();
if (!Coverage)
return 1;