[llvm] r276468 - [llvm-cov] Don't copy stylesheets into index files
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 22 13:49:23 PDT 2016
Author: vedantk
Date: Fri Jul 22 15:49:23 2016
New Revision: 276468
URL: http://llvm.org/viewvc/llvm-project?rev=276468&view=rev
Log:
[llvm-cov] Don't copy stylesheets into index files
Just link in the stylesheet from the toplevel dir of the report.
Modified:
llvm/trunk/test/tools/llvm-cov/style.test
llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp
Modified: llvm/trunk/test/tools/llvm-cov/style.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/style.test?rev=276468&r1=276467&r2=276468&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/style.test (original)
+++ llvm/trunk/test/tools/llvm-cov/style.test Fri Jul 22 15:49:23 2016
@@ -5,7 +5,8 @@ RUN: llvm-cov show %S/Inputs/templateIns
RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %S/showTemplateInstantiations.cpp -format html | FileCheck %s -check-prefix=NODIR
RUN: FileCheck %s -input-file=%t.dir/style.css -check-prefix=STYLE
-RUN: FileCheck %s -input-file=%t.dir/functions.html -check-prefix=FUNCTIONS
+RUN: FileCheck %s -input-file=%t.dir/functions.html -check-prefix=TOPLEVEL
+RUN: FileCheck %s -input-file=%t.dir/index.html -check-prefix=TOPLEVEL
RUN: FileCheck %s -input-file=%t.dir/coverage/tmp/showTemplateInstantiations.cpp.html -check-prefix=FILEVIEW
STYLE-DAG: .red
@@ -19,10 +20,10 @@ STYLE-DAG: .uncovered-line
STYLE-DAG: .tooltip
STYLE-DAG: .tooltip span.tooltip-content
-FUNCTIONS-NOT: <style>
-FUNCTIONS: <head>
-FUNCTIONS: <link rel='stylesheet' type='text/css' href='style.css'>
-FUNCTIONS: </head>
+TOPLEVEL-NOT: <style>
+TOPLEVEL: <head>
+TOPLEVEL: <link rel='stylesheet' type='text/css' href='style.css'>
+TOPLEVEL: </head>
FILEVIEW-NOT: <style>
FILEVIEW: <head>
Modified: llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp?rev=276468&r1=276467&r2=276468&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp (original)
+++ llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp Fri Jul 22 15:49:23 2016
@@ -247,7 +247,8 @@ Error CoveragePrinterHTML::createIndexFi
raw_ostream &OSRef = *OS.get();
// Emit a table containing links to reports for each file in the covmapping.
- emitPrelude(OSRef);
+ assert(Opts.hasOutputDirectory() && "No output directory for index file");
+ emitPrelude(OSRef, getPathToStyle(""));
OSRef << BeginSourceNameDiv << "Index" << EndSourceNameDiv;
OSRef << BeginTable;
for (StringRef SF : SourceFiles) {
More information about the llvm-commits
mailing list