2017-11-09 10:33:43 +08:00
|
|
|
// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=/tmp,%S 2>&1 -show-region-summary -show-instantiation-summary | FileCheck %s
|
|
|
|
// RUN: llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=/tmp,%S %s 2>&1 | FileCheck -check-prefix=FILT %s
|
|
|
|
// RUN: llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=/tmp,%S %s does-not-exist.cpp 2>&1 | FileCheck -check-prefix=FILT %s
|
|
|
|
// RUN: not llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck -check-prefix=NO_FILES %s
|
2017-09-26 07:10:03 +08:00
|
|
|
|
|
|
|
// NO_FILES: Source files must be specified when -show-functions=true is specified
|
2014-09-30 20:45:13 +08:00
|
|
|
|
2016-09-19 08:38:23 +08:00
|
|
|
// CHECK: Regions Missed Regions Cover Functions Missed Functions Executed Instantiations Missed Insts. Executed Lines Missed Lines Cover
|
2015-02-14 10:05:05 +08:00
|
|
|
// CHECK-NEXT: ---
|
2017-11-09 10:33:43 +08:00
|
|
|
// CHECK-NEXT: report.cpp 6 2 66.67% 4 1 75.00% 4 1 75.00% 13 3 76.92%
|
2015-02-14 10:05:05 +08:00
|
|
|
// CHECK-NEXT: ---
|
2017-11-09 10:33:43 +08:00
|
|
|
// CHECK-NEXT: TOTAL 6 2 66.67% 4 1 75.00% 4 1 75.00% 13 3 76.92%
|
2015-02-14 10:05:05 +08:00
|
|
|
|
2017-11-09 10:33:43 +08:00
|
|
|
// FILT: File '{{.*}}report.cpp':
|
2015-02-14 10:05:05 +08:00
|
|
|
// FILT-NEXT: Name Regions Miss Cover Lines Miss Cover
|
|
|
|
// FILT-NEXT: ---
|
2017-11-09 10:33:43 +08:00
|
|
|
// FILT-NEXT: _Z3foob 3 1 66.67% 4 1 75.00%
|
2015-02-14 10:05:05 +08: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: ---
|
2017-11-09 10:33:43 +08:00
|
|
|
// FILT-NEXT: TOTAL 6 2 66.67% 13 3 76.92%
|
2014-09-30 20:45:13 +08:00
|
|
|
|
|
|
|
void foo(bool cond) {
|
|
|
|
if (cond) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void bar() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void func() {
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
foo(false);
|
|
|
|
bar();
|
|
|
|
return 0;
|
|
|
|
}
|
2016-06-29 08:38:21 +08:00
|
|
|
|
|
|
|
// Test that listing multiple functions in a function view works.
|
2017-11-09 10:33:43 +08:00
|
|
|
// RUN: llvm-cov show -o %t.dir %S/Inputs/report.covmapping -instr-profile=%S/Inputs/report.profdata -path-equivalence=/tmp,%S -name-regex=".*" %s
|
|
|
|
// RUN: FileCheck -check-prefix=FUNCTIONS -input-file %t.dir/coverage/tmp/report.cpp.txt %s
|
2016-06-29 08:38:21 +08:00
|
|
|
// FUNCTIONS: _Z3foob
|
|
|
|
// FUNCTIONS: _Z3barv
|
|
|
|
// FUNCTIONS: _Z4func
|