[PATCH] D38507: [llvm-cov] Fix showing title when filtering and not outputting to a directory
Sean Eveson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 10:58:46 PDT 2017
seaneveson updated this revision to Diff 117546.
seaneveson added a comment.
Extend a test that already checked for this to cover filtered output as well.
https://reviews.llvm.org/D38507
Files:
test/tools/llvm-cov/showProjectSummary.cpp
tools/llvm-cov/CodeCoverage.cpp
Index: tools/llvm-cov/CodeCoverage.cpp
===================================================================
--- tools/llvm-cov/CodeCoverage.cpp
+++ tools/llvm-cov/CodeCoverage.cpp
@@ -882,7 +882,7 @@
}
auto OS = std::move(OSOrErr.get());
- bool ShowTitle = true;
+ bool ShowTitle = ViewOpts.hasOutputDirectory();
for (const auto *Function : Functions) {
auto FunctionView = createFunctionView(*Function, *Coverage);
if (!FunctionView) {
Index: test/tools/llvm-cov/showProjectSummary.cpp
===================================================================
--- test/tools/llvm-cov/showProjectSummary.cpp
+++ test/tools/llvm-cov/showProjectSummary.cpp
@@ -13,6 +13,7 @@
// Test console output.
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -path-equivalence=/tmp,%S %s | FileCheck -check-prefixes=TEXT,TEXT-FILE,TEXT-HEADER %S/Inputs/showProjectSummary.test
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -path-equivalence=/tmp,%S -name=main %s | FileCheck -check-prefixes=TEXT,TEXT-FILE,TEXT-HEADER %S/Inputs/showProjectSummary.test
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -path-equivalence=/tmp,%S %s | FileCheck -check-prefixes=TEXT-TITLE,TEXT,TEXT-FILE,TEXT-HEADER %S/Inputs/showProjectSummary.test
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -name=main -path-equivalence=/tmp,%S %s | FileCheck -check-prefixes=TEXT-FUNCTION,TEXT-HEADER %S/Inputs/showProjectSummary.test
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile=%t.profdata -o %t.dir -path-equivalence=/tmp,%S %s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38507.117546.patch
Type: text/x-patch
Size: 1808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171003/85750062/attachment.bin>
More information about the llvm-commits
mailing list