1 // Test visualization of general MC/DC constructs with 0 executed test vectors.
3 // RUN: llvm-profdata merge %S/Inputs/mcdc-general-none.proftext -o %t.profdata
4 // RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s
5 // RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT
9 // CHECK: ------------------
10 // CHECK-NEXT: |---> MC/DC Decision Region (12:7) to (12:27)
12 // CHECK-NEXT: | Number of Conditions: 4
13 // CHECK-NEXT: | Condition C1 --> (12:8)
14 // CHECK-NEXT: | Condition C2 --> (12:13)
15 // CHECK-NEXT: | Condition C3 --> (12:20)
16 // CHECK-NEXT: | Condition C4 --> (12:25)
18 // CHECK-NEXT: | Executed MC/DC Test Vectors:
20 // CHECK-NEXT: | None.
22 // CHECK-NEXT: | C1-Pair: not covered
23 // CHECK-NEXT: | C2-Pair: not covered
24 // CHECK-NEXT: | C3-Pair: not covered
25 // CHECK-NEXT: | C4-Pair: not covered
26 // CHECK-NEXT: | MC/DC Coverage for Decision: 0.00%
28 // CHECK-NEXT: ------------------
31 // Turn off MC/DC visualization.
32 // RUN: llvm-cov show %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s -check-prefix=NOMCDC
33 // NOMCDC-NOT: MC/DC Decision Region
35 // REPORT: Name Regions Miss Cover Lines Miss Cover Branches Miss Cover MC/DC Conditions Miss Cover
36 // REPORT-NEXT: -------------------------------------------------------------------------------------------------------------------------------------------
37 // REPORT-NEXT: _Z4testbbbb 25 0 100.00% 9 0 100.00% 24 2 91.67% 12 12 0.00%
38 // REPORT-NEXT: main 1 0 100.00% 11 0 100.00% 0 0 0.00% 0 0 0.00%
40 // REPORT-NEXT: TOTAL 26 0 100.00% 20 0 100.00% 24 2 91.67% 12 12 0.00%
42 // Turn off MC/DC summary.
43 // RUN: llvm-cov report %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT_NOMCDC
44 // REPORT_NOMCDC-NOT: TOTAL{{.*}}12 12 0.00%
47 // Test file-level report.
48 // RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=FILEREPORT
49 // FILEREPORT: TOTAL{{.*}}12 12 0.00%
53 // RUN: rm -rf %t.html.dir
54 // RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs -format html -o %t.html.dir
55 // RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/mcdc-general.cpp.html %s
56 // HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a href='#L{{[0-9]+}}'><span>
58 // RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s
59 // HTML-INDEX-LABEL: <table>
60 // HTML-INDEX: <td class='column-entry-bold'>Filename</td>
61 // HTML-INDEX: <td class='column-entry-bold'>Function Coverage</td>
62 // HTML-INDEX: <td class='column-entry-bold'>Line Coverage</td>
63 // HTML-INDEX: <td class='column-entry-bold'>Region Coverage</td>
64 // HTML-INDEX: <td class='column-entry-bold'>Branch Coverage</td>
65 // HTML-INDEX: <td class='column-entry-bold'>MC/DC</td>
66 // HTML-INDEX: <a href='coverage{{.*}}mcdc-general.cpp.html'{{.*}}mcdc-general.cpp</a>
67 // HTML-INDEX: <td class='column-entry-green'>
68 // HTML-INDEX: 100.00% (2/2)
69 // HTML-INDEX: 100.00% (20/20)
70 // HTML-INDEX: 100.00% (26/26)
71 // HTML-INDEX: 91.67% (22/24)
72 // HTML-INDEX: 0.00% (0/12)
75 # How to regenerate Inputs/mcdc-general-none.proftext:
76 # Copy Inputs/mcdc-general.proftext and replace all bitmap values with 0.