From 8cb0f6e78e491e9bb8c3612a6e1062243beaad4f Mon Sep 17 00:00:00 2001 From: Yuchen Wu Date: Wed, 18 Dec 2013 21:12:51 +0000 Subject: 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 --- test/tools/llvm-cov/Inputs/test_-b.output | 13 +++++++++++++ test/tools/llvm-cov/Inputs/test_no_options.output | 8 ++++++++ test/tools/llvm-cov/llvm-cov.test | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 test/tools/llvm-cov/Inputs/test_-b.output create mode 100644 test/tools/llvm-cov/Inputs/test_no_options.output (limited to 'test/tools/llvm-cov') 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 -- cgit v1.2.3