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 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile=%t.profdata -o %t.dir -filename-equivalence %s 19 // RUN: FileCheck -check-prefixes=TEXT-FOOTER -input-file=%t.dir/index.txt %s 20 // TEXT-TITLE: Test Suite 21 // TEXT: Coverage Report 22 // TEXT: Created: 23 // TEXT-FILE: showProjectSummary.cpp: 24 // TEXT-FILE: showProjectSummary.covmapping: 25 // TEXT-FUNCTION: main: 26 // TEXT-FOOTER: Generated by llvm-cov 27 28 // Test html output. 29 // RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -filename-equivalence %s 30 // RUN: FileCheck -check-prefixes=HTML,HTML-FILE,HTML-HEADER -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.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 %s 32 // RUN: FileCheck -check-prefixes=HTML-TITLE,HTML,HTML-FILE,HTML-HEADER -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s 33 // RUN: FileCheck -check-prefixes=HTML-TITLE,HTML,HTML-FOOTER -input-file %t.dir/index.html %s 34 // 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 35 // RUN: FileCheck -check-prefixes=HTML-FUNCTION,HTML-HEADER -input-file %t.dir/functions.html %s 36 // HTML-TITLE: <h1>Test Suite</h1> 37 // HTML: <h2>Coverage Report</h2> 38 // HTML: <h4>Created:{{.*}}</h4> 39 // HTML-FILE: <pre>{{.*}}showProjectSummary.cpp (Binary: showProjectSummary.covmapping)</pre> 40 // HTML-FUNCTION: <pre>main</pre> 41 // HTML-HEADER: <td><pre>Line No.</pre></td> 42 // HTML-HEADER: <td><pre>Count</pre></td> 43 // HTML-HEADER: <td><pre>Source (<a href='#L8'>jump to first uncovered line</a>)</pre></td> 44 // HTML-FOOTER: <h5>Generated by llvm-cov{{.*}}</h5> 45