1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 14:33:02 +02:00
llvm-mirror/test/tools/llvm-cov/report.cpp
Vedant Kumar 8a4b0078c7 [llvm-cov] Minor cleanups to prepare for the html format patch
- Add renderView{Header,Footer}, renderLineSuffix, and hasSubViews to
  support creating tables with nested views.

- Move the 'Format' cl::opt to make it easier to extend.

- Just create one function view file, instead of overwriting the same
  file for every new function. Add a regression test for this.

llvm-svn: 274086
2016-06-29 00:38:21 +00:00

43 lines
1.5 KiB
C++

// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence 2>&1 | FileCheck %s
// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT-NEXT %s
// CHECK: Filename Regions Miss Cover Functions Executed
// CHECK-NEXT: ---
// CHECK-NEXT: report.cpp 5 2 60.00% 4 75.00%
// CHECK-NEXT: ---
// CHECK-NEXT: TOTAL 5 2 60.00% 4 75.00%
// FILT: File 'report.cpp':
// FILT-NEXT: Name Regions Miss Cover Lines Miss Cover
// FILT-NEXT: ---
// FILT-NEXT: _Z3foob 2 1 50.00% 4 2 50.00%
// FILT-NEXT: _Z3barv 1 0 100.00% 2 0 100.00%
// FILT-NEXT: _Z4funcv 1 1 0.00% 2 2 0.00%
// FILT-NEXT: main 1 0 100.00% 5 0 100.00%
// FILT-NEXT: ---
// FILT-NEXT: TOTAL 5 2 60.00% 13 4 69.23%
void foo(bool cond) {
if (cond) {
}
}
void bar() {
}
void func() {
}
int main() {
foo(false);
bar();
return 0;
}
// Test that listing multiple functions in a function view works.
// RUN: llvm-cov show -o %t.dir %S/Inputs/report.covmapping -instr-profile=%S/Inputs/report.profdata -filename-equivalence -name-regex=".*" %s
// RUN: FileCheck -check-prefix=FUNCTIONS -input-file %t.dir/functions.txt %s
// FUNCTIONS: _Z3foob
// FUNCTIONS: _Z3barv
// FUNCTIONS: _Z4func