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/showTemplateInstantiations.cpp | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp') diff --git a/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp b/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp index 77ecb473400..8fc45898a8b 100644 --- a/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp +++ b/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp @@ -38,3 +38,48 @@ int main() { // ALL: 1| [[@LINE]]|int main() { } // ALL-NEXT: 1| [[@LINE]]|} // after coverage // ALL-NEXT: | [[@LINE]]|// after // FILTER-NOT: | [[@LINE-1]]|// after + +// Test html output. +// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s -format html -o %t.html.dir +// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence -name=_Z4funcIbEiT_ %s -format html -o %t.html.dir +// RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-ALL -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s +// RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-FILTER -input-file=%t.html.dir/functions.html %s + +// HTML-ALL:
[[@LINE-44]]
// before
+// HTML-FILTER-NOT: 
[[@LINE-45]]
// before
+// HTML-ALL: 
[[@LINE-44]]
template<typename T>
+// HTML-ALL: 
2
[[@LINE-44]]
int func(T x) {
+// HTML-ALL: 
2
[[@LINE-44]]
  if(x)
+// HTML-ALL: 
1
[[@LINE-44]]
    ret
+// HTML-ALL: 
2
[[@LINE-44]]
  else
+// HTML-ALL: 
1
[[@LINE-44]]
    ret
+// HTML-ALL: 
0
[[@LINE-44]]
+// HTML-ALL: 
2
[[@LINE-44]]
}
+
+// HTML-SHARED: 
_Z4funcIbEiT_
+// HTML-SHARED:
1
[[@LINE-53]]
int func(T x) {
+// HTML-SHARED: 
1
[[@LINE-53]]
  if(x)
+// HTML-SHARED: 
1
[[@LINE-53]]
    ret
+// HTML-SHARED: 
1
[[@LINE-53]]
  else
+// HTML-SHARED: 
0
[[@LINE-53]]
+// HTML-SHARED: 
0
[[@LINE-53]]
+// HTML-SHARED: 
1
[[@LINE-53]]
}
+
+// HTML-ALL: 
_Z4funcIiEiT_
+// HTML-FILTER-NOT:
_Z4funcIiEiT_
+// HTML-ALL:
1
[[@LINE-63]]
int func(T x) {
+// HTML-ALL: 
1
[[@LINE-63]]
  if(x)
+// HTML-ALL: 
0
[[@LINE-63]]
+// HTML-ALL: 
1
[[@LINE-63]]
  else
+// HTML-ALL: 
1
[[@LINE-63]]
    ret
+// HTML-ALL: 
0
[[@LINE-63]]
+// HTML-ALL: 
1
[[@LINE-63]]
}
+
+// HTML-ALL: td class='covered-line'>
1
[[@LINE-44]]
int main() {
+// HTML-ALL: 
1
[[@LINE-44]]
  func<int>(0);
+// HTML-ALL: 
1
[[@LINE-44]]
  func<bool>(true);
+// HTML-ALL: 
1
[[@LINE-44]]
  return 0;
+// HTML-ALL: 
1
[[@LINE-44]]
}
+
+// HTML-ALL: 
[[@LINE-45]]
// after
+// HTML-FILTER-NOT: 
[[@LINE-46]]
// after
-- 
cgit v1.2.3