aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoradrianvillin <avillin@cisco.com>2024-01-11 11:59:47 +0100
committerDave Wallace <dwallacelf@gmail.com>2024-05-30 15:59:07 +0000
commit8512145d7c65d56a35994ec1e3470ce2e2e49af7 (patch)
tree1a10a280378a6e0541ef9426d0177a2074b453b0 /Makefile
parent93974e281e7f99309af259c615f7068dee600114 (diff)
hs-test: added targets to makefiles to get coverage from HS tests
Type: make Change-Id: Iae7998692890264dfeea98c165617d0efa024d42 Signed-off-by: adrianvillin <avillin@cisco.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d41ff36904a..1ab387e94d4 100644
--- a/Makefile
+++ b/Makefile
@@ -245,6 +245,7 @@ help:
@echo " build - build debug binaries"
@echo " build-release - build release binaries"
@echo " build-coverity - build coverity artifacts"
+ @echo " build-vpp-gcov - build gcov vpp only"
@echo " rebuild - wipe and build debug binaries"
@echo " rebuild-release - wipe and build release binaries"
@echo " run - run debug binary"
@@ -252,6 +253,8 @@ help:
@echo " debug - run debug binary with debugger"
@echo " debug-release - run release binary with debugger"
@echo " test - build and run tests"
+ @echo " test-cov-hs - build and run host stack tests with coverage"
+ @echo " test-cov-both - build and run python and host stack tests, merge coverage data"
@echo " test-help - show help on test framework"
@echo " run-vat - run vpp-api-test tool"
@echo " pkg-deb - build DEB packages"
@@ -440,6 +443,10 @@ rebuild: wipe build
build-release: $(BR)/.deps.ok
$(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS)))
+.PHONY: build-vpp-gcov
+build-vpp-gcov:
+ $(call test,vpp_gcov)
+
.PHONY: wipe-release
wipe-release: test-wipe $(BR)/.deps.ok
$(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS)))
@@ -486,6 +493,20 @@ test-cov:
$(eval TEST_GCOV=1)
$(call test,vpp_gcov,cov)
+.PHONY: test-cov-hs
+test-cov-hs:
+ @make -C extras/hs-test build-cov
+ @make -C extras/hs-test test-cov
+
+.PHONY: test-cov-both
+test-cov-both:
+ @echo "Running Python, Golang tests and merging coverage reports."
+ find $(BR) -name '*.gcda' -delete
+ @make test-cov
+ find $(BR) -name '*.gcda' -delete
+ @make test-cov-hs
+ @make cov-merge
+
.PHONY: test-cov-build
test-cov-build:
$(eval CC=gcc)
@@ -502,6 +523,14 @@ test-cov-post:
$(eval CC=gcc)
$(call test,vpp_gcov,cov-post)
+.PHONY: cov-merge
+cov-merge:
+ @lcov --add-tracefile $(BR)/test-coverage-merged/coverage-filtered.info \
+ -a $(BR)/test-coverage-merged/coverage-filtered1.info -o $(BR)/test-coverage-merged/coverage-merged.info
+ @genhtml $(BR)/test-coverage-merged/coverage-merged.info \
+ --output-directory $(BR)/test-coverage-merged/html
+ @echo "Code coverage report is in $(BR)/test-coverage-merged/html/index.html"
+
.PHONY: test-all
test-all:
$(eval EXTENDED_TESTS=1)