aboutsummaryrefslogtreecommitdiffstats
path: root/extras
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 /extras
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 'extras')
-rw-r--r--extras/hs-test/Makefile23
-rwxr-xr-xextras/hs-test/script/build_hst.sh2
2 files changed, 25 insertions, 0 deletions
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