summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-09 01:32:55 +0000
committerVedant Kumar <vsk@apple.com>2016-09-09 01:32:55 +0000
commita59334da6baf812ac6e8b2e140a2ac2599654479 (patch)
tree051d7cc872520aab5e89b233b0c4e0cf7ef24d10 /llvm/tools/llvm-cov/SourceCoverageViewText.cpp
parentaae0ba70604be5e0e1a70c05c80dde8a7590f85b (diff)
downloadbcm5719-llvm-a59334da6baf812ac6e8b2e140a2ac2599654479.tar.gz
bcm5719-llvm-a59334da6baf812ac6e8b2e140a2ac2599654479.zip
[llvm-cov] Emit a summary in the report directory's index
llvm-cov writes out an index file in '-output-dir' mode, albeit not a very informative one. Try to fix that by using the CoverageReport API to include some basic summary information in the index file. llvm-svn: 281011
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewText.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewText.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index 3d2c067d0a4..b0676cad7b9 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -11,6 +11,7 @@
///
//===----------------------------------------------------------------------===//
+#include "CoverageReport.h"
#include "SourceCoverageViewText.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
@@ -27,15 +28,17 @@ void CoveragePrinterText::closeViewFile(OwnedStream OS) {
OS->operator<<('\n');
}
-Error CoveragePrinterText::createIndexFile(ArrayRef<StringRef> SourceFiles) {
+Error CoveragePrinterText::createIndexFile(
+ ArrayRef<StringRef> SourceFiles,
+ const coverage::CoverageMapping &Coverage) {
auto OSOrErr = createOutputStream("index", "txt", /*InToplevel=*/true);
if (Error E = OSOrErr.takeError())
return E;
auto OS = std::move(OSOrErr.get());
raw_ostream &OSRef = *OS.get();
- for (StringRef SF : SourceFiles)
- OSRef << getOutputPath(SF, "txt", /*InToplevel=*/false) << '\n';
+ CoverageReport Report(Opts, Coverage);
+ Report.renderFileReports(OSRef);
return Error::success();
}
OpenPOWER on IntegriCloud