From e41072e7f9746fc793a12fda6d00b1c255c98b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 16 Jun 2014 16:24:24 +0200 Subject: [PATCH] Exclude headers from lcov reports The data produced by gcov for static inline functions is too unreliable to be actually useful. Some lines that are covered are not marked as such, some other static inline functions are completely ignored, and the reasons why do not look obvious. --- CMakeLists.txt | 6 ++++-- Makefile | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1246c935..86439ada4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,9 +96,11 @@ if(ENABLE_TESTING) COMMAND rm -rf Coverage COMMAND lcov --capture --initial --directory library/CMakeFiles/polarssl.dir -o files.info COMMAND lcov --capture --directory library/CMakeFiles/polarssl.dir -o tests.info + COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info + COMMAND lcov --remove all.info -o final.info '*.h' COMMAND gendesc tests/Descriptions.txt -o descriptions - COMMAND genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage files.info tests.info - COMMAND rm -f files.info tests.info descriptions + COMMAND genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info + COMMAND rm -f files.info tests.info all.info final.info descriptions ) ADD_CUSTOM_TARGET(memcheck diff --git a/Makefile b/Makefile index 1ec10f2d4..0807e8d2a 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,11 @@ lcov: rm -rf Coverage lcov --capture --initial --directory library -o files.info lcov --capture --directory library -o tests.info + lcov --add-tracefile files.info --add-tracefile tests.info -o all.info + lcov --remove all.info -o final.info '*.h' gendesc tests/Descriptions.txt -o descriptions - genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage files.info tests.info - rm -f files.info tests.info descriptions + genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info + rm -f files.info tests.info all.info final.info descriptions apidoc: mkdir -p apidoc