From 8512145d7c65d56a35994ec1e3470ce2e2e49af7 Mon Sep 17 00:00:00 2001 From: adrianvillin Date: Thu, 11 Jan 2024 11:59:47 +0100 Subject: hs-test: added targets to makefiles to get coverage from HS tests Type: make Change-Id: Iae7998692890264dfeea98c165617d0efa024d42 Signed-off-by: adrianvillin --- extras/hs-test/Makefile | 23 +++++++++++++++++++++++ extras/hs-test/script/build_hst.sh | 2 ++ 2 files changed, 25 insertions(+) (limited to 'extras/hs-test') diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile index 0db3958604e..b809b170e00 100644 --- a/extras/hs-test/Makefile +++ b/extras/hs-test/Makefile @@ -16,6 +16,10 @@ ifeq ($(TEST),) TEST=all endif +ifeq ($(TEST-HS),) +TEST-HS=all +endif + ifeq ($(DEBUG),) DEBUG=false endif @@ -53,6 +57,7 @@ help: @echo " test - run tests" @echo " test-debug - run tests (vpp debug image)" @echo " build - build test infra" + @echo " build-cov - coverage build of VPP and Docker images" @echo " build-debug - build test infra (vpp debug image)" @echo " build-go - just build golang files" @echo " fixstyle - format .go source files" @@ -88,6 +93,10 @@ build-vpp-release: build-vpp-debug: @make -C ../.. build +.PHONY: build-vpp-gcov +build-vpp-gcov: + @make -C ../.. build-vpp-gcov + .build.ok: build @touch .build.ok @@ -112,6 +121,14 @@ test-debug: .deps.ok .build_debug.ok --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) @bash ./script/compress.sh +.PHONY: test-cov +test-cov: .deps.ok .build.ok + -bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \ + --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST-HS) --cpus=$(CPUS) \ + --vppsrc=$(VPPSRC) + @make -C ../.. test-cov-post HS_TEST=1 + @bash ./script/compress.sh + .PHONY: build-go build-go: go build ./tools/http_server @@ -122,6 +139,12 @@ build: .deps.ok build-vpp-release build-go bash ./script/build_hst.sh release @touch .build.ok +.PHONY: build-cov +build-cov: .deps.ok build-vpp-gcov build-go + @rm -f .build.vpp + bash ./script/build_hst.sh gcov + @touch .build.vpp + .PHONY: build-debug build-debug: .deps.ok build-vpp-debug build-go @rm -f .build.ok diff --git a/extras/hs-test/script/build_hst.sh b/extras/hs-test/script/build_hst.sh index cc2d00b6cbd..3b4bc28e275 100755 --- a/extras/hs-test/script/build_hst.sh +++ b/extras/hs-test/script/build_hst.sh @@ -21,6 +21,8 @@ export VPP_WS=../.. if [ "$1" == "debug" ]; then VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp_debug-native/vpp +elif [ "$1" == "gcov" ]; then + VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp_gcov-native/vpp else VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp-native/vpp fi -- cgit 1.2.3-korg