hs-test: added targets to makefiles to get coverage from HS tests

Type: make

Change-Id: Iae7998692890264dfeea98c165617d0efa024d42
Signed-off-by: adrianvillin <avillin@cisco.com>
This commit is contained in:
adrianvillin
2024-01-11 11:59:47 +01:00
committed by Dave Wallace
parent 93974e281e
commit 8512145d7c
4 changed files with 63 additions and 6 deletions

View File

@ -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)