summaryrefslogtreecommitdiff
path: root/test/tools/llvm-cov
diff options
context:
space:
mode:
authorYuchen Wu <yuchenericwu@hotmail.com>2013-12-18 21:12:51 +0000
committerYuchen Wu <yuchenericwu@hotmail.com>2013-12-18 21:12:51 +0000
commit8cb0f6e78e491e9bb8c3612a6e1062243beaad4f (patch)
treef02504492fb2608f38c4f5b05eff46fea0a62848 /test/tools/llvm-cov
parent4fc184584c8271fcd6dea39676b39681bf356f83 (diff)
downloadllvm-8cb0f6e78e491e9bb8c3612a6e1062243beaad4f.tar.gz
llvm-8cb0f6e78e491e9bb8c3612a6e1062243beaad4f.tar.bz2
llvm-8cb0f6e78e491e9bb8c3612a6e1062243beaad4f.tar.xz
llvm-cov: Print coverage summary to STDOUT.
File summaries will now be optionally outputted which will give line, branching and call coverage info. Unfortunately, clang's current instrumentation does not give enough information to deduce function calls, something that gcc is able to do. Thus, no calls are always outputted to be consistent with gcov output. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools/llvm-cov')
-rw-r--r--test/tools/llvm-cov/Inputs/test_-b.output13
-rw-r--r--test/tools/llvm-cov/Inputs/test_no_options.output8
-rw-r--r--test/tools/llvm-cov/llvm-cov.test4
3 files changed, 23 insertions, 2 deletions
diff --git a/test/tools/llvm-cov/Inputs/test_-b.output b/test/tools/llvm-cov/Inputs/test_-b.output
new file mode 100644
index 0000000000..4003ce8e69
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/test_-b.output
@@ -0,0 +1,13 @@
+File 'test.cpp'
+Lines executed:84.21% of 38
+Branches executed:100.00% of 15
+Taken at least once:86.67% of 15
+No calls
+test.cpp:creating 'test.cpp.gcov'
+
+File './test.h'
+Lines executed:100.00% of 1
+No branches
+No calls
+./test.h:creating './test.h.gcov'
+
diff --git a/test/tools/llvm-cov/Inputs/test_no_options.output b/test/tools/llvm-cov/Inputs/test_no_options.output
new file mode 100644
index 0000000000..93ea726720
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/test_no_options.output
@@ -0,0 +1,8 @@
+File 'test.cpp'
+Lines executed:84.21% of 38
+test.cpp:creating 'test.cpp.gcov'
+
+File './test.h'
+Lines executed:100.00% of 1
+./test.h:creating './test.h.gcov'
+
diff --git a/test/tools/llvm-cov/llvm-cov.test b/test/tools/llvm-cov/llvm-cov.test
index 02b8a3db9a..da39307168 100644
--- a/test/tools/llvm-cov/llvm-cov.test
+++ b/test/tools/llvm-cov/llvm-cov.test
@@ -5,7 +5,7 @@ RUN: mkdir %t
RUN: cd %t
RUN: cp %p/Inputs/test* .
-RUN: llvm-cov -gcno=test.gcno -gcda=test.gcda
+RUN: llvm-cov -gcno=test.gcno -gcda=test.gcda | diff test_no_options.output -
RUN: diff -aub test_no_options.cpp.gcov test.cpp.gcov
RUN: diff -aub test_no_options.h.gcov test.h.gcov
@@ -13,7 +13,7 @@ RUN: llvm-cov -gcno=test.gcno -gcda=test.gcda -a
RUN: diff -aub test_-a.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a.h.gcov test.h.gcov
-RUN: llvm-cov -gcno=test.gcno -gcda=test.gcda -a -b
+RUN: llvm-cov -gcno=test.gcno -gcda=test.gcda -a -b | diff test_-b.output -
RUN: diff -aub test_-a_-b.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a_-b.h.gcov test.h.gcov