[llvm] r314885 - [llvm-cov] Fix showing title when filtering and not outputting to a directory
Sean Eveson via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 01:54:37 PDT 2017
Author: seaneveson
Date: Wed Oct 4 01:54:37 2017
New Revision: 314885
URL: http://llvm.org/viewvc/llvm-project?rev=314885&view=rev
Log:
[llvm-cov] Fix showing title when filtering and not outputting to a directory
Differential Revision: https://reviews.llvm.org/D38507
Modified:
llvm/trunk/test/tools/llvm-cov/showProjectSummary.cpp
llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
Modified: llvm/trunk/test/tools/llvm-cov/showProjectSummary.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/showProjectSummary.cpp?rev=314885&r1=314884&r2=314885&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/showProjectSummary.cpp (original)
+++ llvm/trunk/test/tools/llvm-cov/showProjectSummary.cpp Wed Oct 4 01:54:37 2017
@@ -13,6 +13,7 @@ int main(int argc, char ** argv) {
// 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
Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=314885&r1=314884&r2=314885&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Wed Oct 4 01:54:37 2017
@@ -882,7 +882,7 @@ int CodeCoverageTool::show(int argc, con
}
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) {
More information about the llvm-commits
mailing list