summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-09 01:32:55 +0000
committerVedant Kumar <vsk@apple.com>2016-09-09 01:32:55 +0000
commita59334da6baf812ac6e8b2e140a2ac2599654479 (patch)
tree051d7cc872520aab5e89b233b0c4e0cf7ef24d10 /llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
parentaae0ba70604be5e0e1a70c05c80dde8a7590f85b (diff)
downloadbcm5719-llvm-a59334da6baf812ac6e8b2e140a2ac2599654479.tar.gz
bcm5719-llvm-a59334da6baf812ac6e8b2e140a2ac2599654479.zip
[llvm-cov] Emit a summary in the report directory's index
llvm-cov writes out an index file in '-output-dir' mode, albeit not a very informative one. Try to fix that by using the CoverageReport API to include some basic summary information in the index file. llvm-svn: 281011
Diffstat (limited to 'llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp')
-rw-r--r--llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp b/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
index f5448322cea..8d4397a0a09 100644
--- a/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
+++ b/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
@@ -35,9 +35,9 @@ int main() { // TEXT: [[@LINE]]| 161|int main(
// RUN: FileCheck -check-prefixes=TEXT,WHOLE-FILE -input-file %t.dir/coverage/tmp/showLineExecutionCounts.cpp.txt %s
// RUN: FileCheck -check-prefixes=TEXT,FILTER -input-file %t.dir/functions.txt %s
//
-// Test index creation.
-// RUN: FileCheck -check-prefix=INDEX -input-file %t.dir/index.txt %s
-// INDEX: showLineExecutionCounts.cpp.txt
+// RUN: llvm-cov export %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -name=main 2>/dev/null > %t.export.json
+// RUN: FileCheck -input-file %t.export.json %S/Inputs/lineExecutionCounts.json
+// RUN: cat %t.export.json | %python -c "import json, sys; json.loads(sys.stdin.read())"
//
// Test html output.
// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -format html -o %t.html.dir -instr-profile %t.profdata -filename-equivalence %s
@@ -69,7 +69,24 @@ int main() { // TEXT: [[@LINE]]| 161|int main(
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>}
// HTML-WHOLE-FILE: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after
// HTML-FILTER-NOT: <td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after
-
-// RUN: llvm-cov export %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -name=main 2>/dev/null > %t.export.json
-// RUN: FileCheck -input-file %t.export.json %S/Inputs/lineExecutionCounts.json
-// RUN: cat %t.export.json | %python -c "import json, sys; json.loads(sys.stdin.read())"
+//
+// Test index creation.
+// RUN: FileCheck -check-prefix=TEXT-INDEX -input-file %t.dir/index.txt %s
+// TEXT-INDEX: Filename
+// TEXT-INDEX-NEXT: ---
+// TEXT-INDEX-NEXT: {{.*}}showLineExecutionCounts.cpp
+//
+// RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s
+// HTML-INDEX-LABEL: <table>
+// HTML-INDEX: <td class='column-entry'>Filename</td>
+// HTML-INDEX: <td class='column-entry'>Region Coverage</td>
+// HTML-INDEX: <td class='column-entry'>Function Coverage</td>
+// HTML-INDEX: <td class='column-entry'>Line Coverage</td>
+// HTML-INDEX: <a href='coverage{{.*}}showLineExecutionCounts.cpp.html'{{.*}}showLineExecutionCounts.cpp</a>
+// HTML-INDEX: <td class='column-entry-red'>
+// HTML-INDEX: 70.00% (7/10)
+// HTML-INDEX: <td class='column-entry-green'>
+// HTML-INDEX: 100.00% (1/1)
+// HTML-INDEX: <td class='column-entry-yellow'>
+// HTML-INDEX: 80.00% (16/20)
+// HTML-INDEX: TOTALS
OpenPOWER on IntegriCloud