diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 21 | ||||
-rw-r--r-- | extras/hs-test/Makefile | 26 | ||||
-rw-r--r-- | extras/hs-test/hs_test.sh | 7 | ||||
-rw-r--r-- | test/Makefile | 9 |
5 files changed, 42 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore index 8d5b84605c4..9d2ecd8f6b3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /build-root/*.tar.xz /build-root/*.changes /build-root/rpmbuild/ -/build-root/test-coverage/ +/build-root/test-coverage*/ /build-root/test/ /build-config.mk /build/external/*.tar.gz @@ -297,7 +297,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 " build-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" @@ -452,7 +452,7 @@ endif install-deps: install-dep define make - @$(MAKE) -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2) + @$(MAKE) -C $(BR) CC=$(CC) PLATFORM=$(PLATFORM) TAG=$(1) $(2) endef $(BR)/scripts/.version: @@ -507,9 +507,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: build-gcov +build-gcov: $(BR)/.deps.ok + $(eval CC=gcc) + $(call make,vpp_gcov,$(addsuffix -install,$(TARGETS))) .PHONY: wipe-release wipe-release: test-wipe $(BR)/.deps.ok @@ -559,9 +560,13 @@ test-cov: $(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 +test-cov-hs: build-gcov + @$(MAKE) -C extras/hs-test test-cov \ + VPP_BUILD_DIR=$(BR)/build-vpp_gcov-native/vpp + +.PHONY: test-cov-post-standalone +test-cov-post-standalone: + $(MAKE) -C test cov-post VPP_BUILD_DIR=$(BR)/build-vpp_gcov-native/vpp .PHONY: test-cov-both test-cov-both: diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile index 6b2a0477813..c6f8c39b26f 100644 --- a/extras/hs-test/Makefile +++ b/extras/hs-test/Makefile @@ -57,6 +57,10 @@ ifeq ($(ARCH),) ARCH=$(shell dpkg --print-architecture) endif +ifeq ($(NO_COLOR),) +VERBOSE=false +endif + FORCE_BUILD?=true .PHONY: help @@ -91,6 +95,7 @@ help: @echo " REPEAT=[n] - repeat tests up to N times or until a failure occurs" @echo " CPU0=[true|false] - use cpu0" @echo " DRYRUN=[true|false] - set up containers but don't run tests" + @echo " NO_COLOR=[true|false] - disables colorful Docker and Ginkgo output" .PHONY: list-tests list-tests: @@ -107,13 +112,13 @@ build-vpp-debug: .PHONY: build-vpp-gcov build-vpp-gcov: - @$(MAKE) -C ../.. build-vpp-gcov + @$(MAKE) -C ../.. build-gcov .build.ok: build @touch .build.ok -.build.cov.ok: build-vpp-gcov - @touch .build.cov.ok +.build.cov.ok: build-cov + @touch .build.ok .build_debug.ok: build-debug @touch .build.ok @@ -124,7 +129,7 @@ test: .deps.ok .build.ok @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \ --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --cpu0=$(CPU0) \ - --dryrun=$(DRYRUN) --skip=$(SKIP); \ + --dryrun=$(DRYRUN) --skip=$(SKIP) --no_color=$(NO_COLOR); \ ./script/compress.sh $$? .PHONY: test-debug @@ -133,16 +138,21 @@ test-debug: .deps.ok .build_debug.ok @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \ --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --debug_build=true \ - --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP); \ + --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP) --no_color=$(NO_COLOR); \ ./script/compress.sh $$? +.PHONY: wipe-lcov +wipe-lcov: + @lcov --zerocounters --directory $(WS_ROOT)/build-root/build-vpp_gcov-native/vpp + .PHONY: test-cov -test-leak: FORCE_BUILD=false -test-cov: .deps.ok .build.cov.ok +test-cov: FORCE_BUILD=false +test-cov: .deps.ok .build.cov.ok wipe-lcov @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST-HS) --cpus=$(CPUS) \ - --vppsrc=$(VPPSRC) --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP); \ + --vppsrc=$(VPPSRC) --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP) --no_color=$(NO_COLOR); \ ./script/compress.sh $$? + $(MAKE) -C ../.. test-cov-post-standalone HS_TEST=1 .PHONY: test-leak test-leak: .deps.ok .build_debug.ok diff --git a/extras/hs-test/hs_test.sh b/extras/hs-test/hs_test.sh index bcada2c73d6..f333b60203d 100644 --- a/extras/hs-test/hs_test.sh +++ b/extras/hs-test/hs_test.sh @@ -14,6 +14,7 @@ ginkgo_args= tc_names=() skip_names=() dryrun= +no_color= for i in "$@" do @@ -96,6 +97,12 @@ case "${i}" in leak_check_set=1 fi ;; + --no_color=*) + no_color="${i#*=}" + if [ "$no_color" = "true" ]; then + ginkgo_args="$ginkgo_args --no-color" + fi + ;; esac done diff --git a/test/Makefile b/test/Makefile index 79feba9165e..1d22832edb7 100644 --- a/test/Makefile +++ b/test/Makefile @@ -389,23 +389,20 @@ COV_REM_TODO_NO_TEST="*/vpp-api/client/*" "*/plugins/prom/*" \ "*/vnet/ethernet/ethernet_format_fns.h" \ "*/plugins/ikev2/ikev2_format.c" "*/vnet/bier/bier_types.c" -COV_REM_ALT_TEST="*/plugins/hs_apps/*" "*/plugins/http/*.h" - .PHONY: cov-post cov-post: wipe-cov $(BUILD_COV_DIR) - @lcov --ignore-errors --capture \ + @lcov --ignore-errors unused,empty,mismatch,gcov --capture \ --directory $(VPP_BUILD_DIR) \ --output-file $(BUILD_COV_DIR)/coverage$(HS_TEST).info @test -z "$(EXTERN_COV_DIR)" || \ - lcov --ignore-errors --capture \ + lcov --ignore-errors unused,empty,mismatch,gcov --capture \ --directory $(EXTERN_COV_DIR) \ --output-file $(BUILD_COV_DIR)/extern-coverage$(HS_TEST).info - @lcov --ignore-errors --remove $(BUILD_COV_DIR)/coverage$(HS_TEST).info \ + @lcov --ignore-errors unused,empty,mismatch,gcov --remove $(BUILD_COV_DIR)/coverage$(HS_TEST).info \ $(COV_REM_NOT_CODE) \ $(COV_REM_DRIVERS) \ $(COV_REM_TODO_NO_TEST) \ $(COV_REM_UNUSED_FEAT) \ - $(COV_REM_ALT_TEST) \ -o $(BUILD_COV_DIR)/coverage-filtered$(HS_TEST).info @genhtml $(BUILD_COV_DIR)/coverage-filtered$(HS_TEST).info \ --output-directory $(BUILD_COV_DIR)/html |