|
| 1 | +// Basic handling of line counts. |
| 2 | +// RUN: rm -rf %t.dir |
| 3 | +// RUN: llvm-profdata merge %S/Inputs/lineExecutionCounts.proftext -o %t.profdata |
| 4 | + |
| 5 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs | FileCheck -check-prefixes=TEXT,WHOLE-FILE -D#C=999 -DC16K2=16.2k -DC16K1=16.1k %S/Inputs/showLineExecutionCounts.cpp |
| 6 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -binary-counters=true -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs | FileCheck -check-prefixes=TEXT,WHOLE-FILE -D#C=1 -DC16K2=1 -DC16K1=1 %S/Inputs/showLineExecutionCounts.cpp |
| 7 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main | FileCheck -check-prefixes=TEXT,FILTER -D#C=999 -DC16K2=16.2k -DC16K1=16.1k %S/Inputs/showLineExecutionCounts.cpp |
| 8 | + |
| 9 | +// Test -output-dir. |
| 10 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -o %t.dir/show -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs |
| 11 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -output-dir %t.dir/show.filtered -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main |
| 12 | +// RUN: FileCheck -check-prefixes=TEXT,WHOLE-FILE -D#C=999 -DC16K2=16.2k -DC16K1=16.1k -input-file %t.dir/show/coverage/tmp/showLineExecutionCounts.cpp.txt %S/Inputs/showLineExecutionCounts.cpp |
| 13 | +// RUN: FileCheck -check-prefixes=TEXT,FILTER -D#C=999 -DC16K2=16.2k -DC16K1=16.1k -input-file %t.dir/show.filtered/coverage/tmp/showLineExecutionCounts.cpp.txt %S/Inputs/showLineExecutionCounts.cpp |
| 14 | +// |
| 15 | +// RUN: llvm-cov export %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata 2>/dev/null -summary-only > %t.export-summary.json |
| 16 | +// RUN: not grep '"name":"main"' %t.export-summary.json |
| 17 | +// |
| 18 | +// Test html output. |
| 19 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -format html -o %t.dir/html -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs |
| 20 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -format html -o %t.dir/html.binary -binary-counters=true -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs |
| 21 | +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -format html -o %t.dir/html.filtered -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main |
| 22 | +// RUN: FileCheck -check-prefixes=HTML,HTML-WHOLE-FILE -input-file %t.dir/html/coverage/tmp/showLineExecutionCounts.cpp.html %S/Inputs/showLineExecutionCounts.cpp |
| 23 | +// RUN: FileCheck -check-prefixes=HTML-BINARY,HTML-WHOLE-FILE -input-file %t.dir/html.binary/coverage/tmp/showLineExecutionCounts.cpp.html %S/Inputs/showLineExecutionCounts.cpp |
| 24 | +// RUN: FileCheck -check-prefixes=HTML,HTML-FILTER -input-file %t.dir/html.filtered/coverage/tmp/showLineExecutionCounts.cpp.html %S/Inputs/showLineExecutionCounts.cpp |
| 25 | +// |
| 26 | +// Test index creation. |
| 27 | +// RUN: FileCheck -check-prefix=TEXT-INDEX -input-file %t.dir/show/index.txt %s |
| 28 | +// TEXT-INDEX: Filename |
| 29 | +// TEXT-INDEX-NEXT: --- |
| 30 | +// TEXT-INDEX-NEXT: {{.*}}showLineExecutionCounts.cpp |
| 31 | +// |
| 32 | +// RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.dir/html/index.html %s |
| 33 | +// HTML-INDEX-LABEL: <table> |
| 34 | +// HTML-INDEX: <td class='column-entry-bold'>Filename</td> |
| 35 | +// HTML-INDEX: <td class='column-entry-bold'>Function Coverage</td> |
| 36 | +// HTML-INDEX: <td class='column-entry-bold'>Line Coverage</td> |
| 37 | +// HTML-INDEX: <td class='column-entry-bold'>Region Coverage</td> |
| 38 | +// HTML-INDEX: <a href='coverage{{.*}}showLineExecutionCounts.cpp.html'{{.*}}showLineExecutionCounts.cpp</a> |
| 39 | +// HTML-INDEX: <td class='column-entry-green'> |
| 40 | +// HTML-INDEX: 100.00% (1/1) |
| 41 | +// HTML-INDEX: <td class='column-entry-yellow'> |
| 42 | +// HTML-INDEX: 90.00% (18/20) |
| 43 | +// HTML-INDEX: <td class='column-entry-red'> |
| 44 | +// HTML-INDEX: 72.73% (8/11) |
| 45 | +// HTML-INDEX: <tr class='light-row-bold'> |
| 46 | +// HTML-INDEX: Totals |
0 commit comments