aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2024-12-18 17:38:23 +0100
committerDave Wallace <dwallacelf@gmail.com>2025-03-24 13:48:01 +0000
commit7aebf804fe0050d4a48aab591b55f026e8dcc4c4 (patch)
tree0b3246db81a92fb240d19e9f534b7b3c49a8ffb5 /test
parente1705791e6fa7d80d14110cabbc6979d497e9e12 (diff)
build: fix coverage for various lcov versions
Starting with lcov version 2, we need to add some errors filtering. Unfortunately, those filters are not available with lcov version 1. Type: fix Fixes: 66fcfb845b8e588901b4f663435e9e1b30499467 Change-Id: Ic8f4c55be89dcc59370b5a69ed8e8f39c5647ec8 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/Makefile b/test/Makefile
index e26bf7f5a0f..de3a3ca2a52 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -399,16 +399,22 @@ COV_REM_HST_UNUSED_FEAT= "*/plugins/ping/*" "*/plugins/unittest/mpcap_node.c" "*
"*/vppinfra/pcap.c" "*/vppinfra/pcap_funcs.h"
endif
+LCOV_VERSION=$(shell lcov --version | sed -E 's/^lcov: LCOV version ([0-9]+)[.].*/\1/')
+LCOV_IGNORE_ERRORS=
+ifeq ($(LCOV_VERSION),2)
+LCOV_IGNORE_ERRORS=--ignore-errors unused,empty,mismatch,gcov
+endif
+
.PHONY: cov-post
cov-post: wipe-cov $(BUILD_COV_DIR)
- @lcov --ignore-errors unused,empty,mismatch,gcov --capture \
+ @lcov $(LCOV_IGNORE_ERRORS) --capture \
--directory $(VPP_BUILD_DIR) \
--output-file $(BUILD_COV_DIR)/coverage$(HS_TEST).info
@test -z "$(EXTERN_COV_DIR)" || \
- lcov --ignore-errors unused,empty,mismatch,gcov --capture \
+ lcov $(LCOV_IGNORE_ERRORS) --capture \
--directory $(EXTERN_COV_DIR) \
--output-file $(BUILD_COV_DIR)/extern-coverage$(HS_TEST).info
- @lcov --ignore-errors unused,empty,mismatch,gcov --remove $(BUILD_COV_DIR)/coverage$(HS_TEST).info \
+ @lcov $(LCOV_IGNORE_ERRORS) --remove $(BUILD_COV_DIR)/coverage$(HS_TEST).info \
$(COV_REM_NOT_CODE) \
$(COV_REM_DRIVERS) \
$(COV_REM_TODO_NO_TEST) \