1 // RUN: llvm-profdata merge -o %t.profdata %S/Inputs/showProjectSummary.proftext 2 3 int main(int argc, char ** argv) { 4 int x=0; 5 for (int i = 0; i < 20; ++i) 6 x *= 2; 7 if (x >= 100) 8 x = x / 2; 9 else 10 x = x * 2; 11 return x; 12 } 13 14 // Test console output. 15 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck -check-prefixes=TEXT,TEXT-FILE,TEXT-HEADER %s 16 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence %s | FileCheck -check-prefixes=TEXT-TITLE,TEXT,TEXT-FILE,TEXT-HEADER %s 17 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -name=main -filename-equivalence %s | FileCheck -check-prefixes=TEXT-FUNCTION,TEXT-HEADER %s 18 // TEXT-TITLE: Test Suite 19 // TEXT: Code Coverage Report 20 // TEXT: Created: 21 // TEXT-FILE: showProjectSummary.cpp: 22 // TEXT-FILE: showProjectSummary.covmapping: 23 // TEXT-FUNCTION: main: 24 25 // Test html output. 26 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -filename-equivalence %s 27 // RUN: FileCheck -check-prefixes=HTML,HTML-FILE,HTML-HEADER,HTML-UNCOVEREDLINE -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s 28 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence %s 29 // RUN: FileCheck -check-prefixes=HTML-TITLE,HTML,HTML-FILE,HTML-HEADER,HTML-UNCOVEREDLINE -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s 30 // RUN: FileCheck -check-prefixes=HTML-TITLE,HTML -input-file %t.dir/index.html %s 31 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence -name=main %s 32 // RUN: FileCheck -check-prefixes=HTML-FUNCTION,HTML-HEADER -input-file %t.dir/functions.html %s 33 // HTML-TITLE: <div class='project-title'> 34 // HTML-TITLE: <span>Test Suite</span> 35 // HTML: <div class='report-title'> 36 // HTML: <span>Code Coverage Report</span> 37 // HTML: <div class='created-time'> 38 // HTML: <span>Created: 39 // HTML-FILE: <pre>Source: {{.*}}showProjectSummary.cpp (Binary: showProjectSummary.covmapping)</pre> 40 // HTML-FUNCTION: <pre>main</pre> 41 // HTML-UNCOVEREDLINE: <a href='#L8'>Go to first unexecuted line</a> 42 // HTML-HEADER: <tr><td><span><pre>Line No.</pre></span></td> 43 // HTML-HEADER: <td><span><pre>Count</pre></span></td> 44 // HTML-HEADER: <td><span><pre>Source</pre></span></td> 45