From 4c01092a25506abfc75e36ce625cf0c2c3446ddc Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Wed, 6 Jul 2016 21:44:05 +0000 Subject: [llvm-cov] Add support for creating html reports Based on a patch by Harlan Haskins! Differential Revision: http://reviews.llvm.org/D18278 llvm-svn: 274688 --- .../tools/llvm-cov/showLineExecutionCounts.cpp | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp') diff --git a/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp b/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp index b8ccdd4aa3e..c624c147820 100644 --- a/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp +++ b/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp @@ -38,3 +38,34 @@ int main() { // TEXT: 161| [[@LINE]]|int main( // Test index creation. // RUN: FileCheck -check-prefix=INDEX -input-file %t.dir/index.txt %s // INDEX: showLineExecutionCounts.cpp.txt +// +// Test html output. +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -format html -o %t.html.dir -instr-profile %t.profdata -filename-equivalence %s +// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -format html -o %t.html.dir -instr-profile %t.profdata -filename-equivalence -name=main %s +// RUN: FileCheck -check-prefixes=HTML,HTML-WHOLE-FILE -input-file %t.html.dir/coverage/tmp/showLineExecutionCounts.cpp.html %s +// RUN: FileCheck -check-prefixes=HTML,HTML-FILTER -input-file %t.html.dir/functions.html %s +// +// HTML-WHOLE-FILE:
[[@LINE-44]]
// before
+// HTML-FILTER-NOT: 
[[@LINE-45]]
// before
+// HTML: 
161
[[@LINE-44]]
int main() {
+// HTML: 
161
[[@LINE-44]]
  int x = 0
+// HTML: 
161
[[@LINE-44]]
+// HTML: 
0
[[@LINE-44]]
  if (x) {
+// HTML: 
0
[[@LINE-44]]
+// HTML: 
161
[[@LINE-44]]
  }
+// HTML: 
161
[[@LINE-44]]
    x = 1;
+// HTML: 
161
[[@LINE-44]]
  }
+// HTML: 
161
[[@LINE-44]]
+// HTML: 
16.2k
[[@LINE-44]]
  for (int i = 0; i < 100; ++i)
+// HTML: 
16.1k
[[@LINE-44]]
    x = 1;
+// HTML: 
16.1k
[[@LINE-44]]
  }
+// HTML: 
161
[[@LINE-44]]
+// HTML: 
161
[[@LINE-44]]
  x = x < 10
+// HTML: 
161
[[@LINE-44]]
  x = x > 10
+// HTML: 
0
[[@LINE-44]]
        x - 1:
+// HTML: 
161
[[@LINE-44]]
        x + 1;
+// HTML: 
161
[[@LINE-44]]
+// HTML: 
161
[[@LINE-44]]
  return 0;
+// HTML: 
161
[[@LINE-44]]
}
+// HTML-WHOLE-FILE: 
[[@LINE-44]]
// after
+// HTML-FILTER-NOT: 
[[@LINE-45]]
// after
-- 
cgit v1.2.3