summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
diff options
context:
space:
mode:
authorYing Yi <maggieyi666@gmail.com>2016-08-24 14:27:23 +0000
committerYing Yi <maggieyi666@gmail.com>2016-08-24 14:27:23 +0000
commit84dc971ee2bc444a41d01051dba5b83d103ad952 (patch)
treeed2637dc11ef83639d3aa81a281d6463dc8882fd /llvm/tools/llvm-cov/SourceCoverageViewText.cpp
parentc22e32deac405e042ffe4f05bf01bd5b6e3aa536 (diff)
downloadbcm5719-llvm-84dc971ee2bc444a41d01051dba5b83d103ad952.tar.gz
bcm5719-llvm-84dc971ee2bc444a41d01051dba5b83d103ad952.zip
[llvm-cov] Add the project summary to each source file coverage report.
This patch includes the following changes: - Included header "Code coverage report" and include the date that the report was created. - Included title (as specified in a command line option, (i.e llvm-cov -project-title="Simple Test") - In the summary, list the elf files that the source code file has contributed to. - Used column heading for "Line No.", "Count No.", Source". Differential Revision: https://reviews.llvm.org/D23345 llvm-svn: 279628
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewText.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewText.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index ae9d6daed08..2f568b2b838 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -63,9 +63,13 @@ void SourceCoverageViewText::renderViewHeader(raw_ostream &) {}
void SourceCoverageViewText::renderViewFooter(raw_ostream &) {}
-void SourceCoverageViewText::renderSourceName(raw_ostream &OS) {
+void SourceCoverageViewText::renderSourceName(raw_ostream &OS, bool WholeFile) {
getOptions().colored_ostream(OS, raw_ostream::CYAN) << getSourceName()
<< ":\n";
+ if (WholeFile) {
+ getOptions().colored_ostream(OS, raw_ostream::CYAN)
+ << getOptions().ObjectFilename << ":\n";
+ }
}
void SourceCoverageViewText::renderLinePrefix(raw_ostream &OS,
@@ -211,3 +215,18 @@ void SourceCoverageViewText::renderInstantiationView(raw_ostream &OS,
OS << ' ';
ISV.View->print(OS, /*WholeFile=*/false, /*ShowSourceName=*/true, ViewDepth);
}
+
+void SourceCoverageViewText::renderCellInTitle(raw_ostream &OS,
+ StringRef CellText) {
+ if (getOptions().hasProjectTitle())
+ getOptions().colored_ostream(OS, raw_ostream::CYAN)
+ << getOptions().ProjectTitle << "\n";
+
+ getOptions().colored_ostream(OS, raw_ostream::CYAN) << CellText << "\n";
+
+ if (getOptions().hasCreatedTime())
+ getOptions().colored_ostream(OS, raw_ostream::CYAN)
+ << getOptions().CreatedTimeStr << "\n";
+}
+
+void SourceCoverageViewText::renderTableHeader(raw_ostream &, unsigned) {}
OpenPOWER on IntegriCloud