2016-08-24 22:27:23 +08:00
|
|
|
// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/showProjectSummary.proftext
|
|
|
|
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
int x=0;
|
|
|
|
for (int i = 0; i < 20; ++i)
|
|
|
|
x *= 2;
|
|
|
|
if (x >= 100)
|
|
|
|
x = x / 2;
|
|
|
|
else
|
|
|
|
x = x * 2;
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test console output.
|
|
|
|
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck -check-prefixes=TEXT,TEXT-FILE,TEXT-HEADER %s
|
|
|
|
// 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
|
|
|
|
// 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
|
|
|
|
// TEXT-TITLE: Test Suite
|
2016-09-11 03:37:20 +08:00
|
|
|
// TEXT: Coverage Report
|
2016-08-24 22:27:23 +08:00
|
|
|
// TEXT: Created:
|
|
|
|
// TEXT-FILE: showProjectSummary.cpp:
|
|
|
|
// TEXT-FILE: showProjectSummary.covmapping:
|
|
|
|
// TEXT-FUNCTION: main:
|
|
|
|
|
|
|
|
// Test html output.
|
|
|
|
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -filename-equivalence %s
|
2016-09-07 03:31:18 +08:00
|
|
|
// RUN: FileCheck -check-prefixes=HTML,HTML-FILE,HTML-HEADER,HTML-UNCOVEREDLINE -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s
|
2016-08-24 22:27:23 +08:00
|
|
|
// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence %s
|
2016-09-07 03:31:18 +08:00
|
|
|
// RUN: FileCheck -check-prefixes=HTML-TITLE,HTML,HTML-FILE,HTML-HEADER,HTML-UNCOVEREDLINE -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s
|
2016-08-24 22:27:23 +08:00
|
|
|
// RUN: FileCheck -check-prefixes=HTML-TITLE,HTML -input-file %t.dir/index.html %s
|
|
|
|
// 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
|
|
|
|
// RUN: FileCheck -check-prefixes=HTML-FUNCTION,HTML-HEADER -input-file %t.dir/functions.html %s
|
2016-09-11 03:37:20 +08:00
|
|
|
// HTML-TITLE: <h1>Test Suite</h1>
|
|
|
|
// HTML: <h2>Coverage Report</h2>
|
|
|
|
// HTML: <h4>Created:{{.*}}</h4>
|
|
|
|
// HTML-FILE: <pre>{{.*}}showProjectSummary.cpp (Binary: showProjectSummary.covmapping)</pre>
|
2016-09-08 08:56:48 +08:00
|
|
|
// HTML-FUNCTION: <pre>main</pre>
|
2016-09-07 03:31:18 +08:00
|
|
|
// HTML-UNCOVEREDLINE: <a href='#L8'>Go to first unexecuted line</a>
|
2016-08-24 22:27:23 +08:00
|
|
|
// HTML-HEADER: <tr><td><span><pre>Line No.</pre></span></td>
|
2016-08-31 08:09:44 +08:00
|
|
|
// HTML-HEADER: <td><span><pre>Count</pre></span></td>
|
2016-08-24 22:27:23 +08:00
|
|
|
// HTML-HEADER: <td><span><pre>Source</pre></span></td>
|