tests: fix setting gcov flag for test-cov target
[vpp.git] / Makefile
index 88d42df..d92e1e5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -65,10 +65,10 @@ endif
 DEB_DEPENDS  = curl build-essential autoconf automake ccache
 DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-python
 DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
-DEB_DEPENDS += lcov chrpath autoconf libnuma-dev
+DEB_DEPENDS += gcovr lcov chrpath autoconf libnuma-dev
 DEB_DEPENDS += python3-all python3-setuptools check
 DEB_DEPENDS += libffi-dev python3-ply
-DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml
+DEB_DEPENDS += cmake ninja-build python3-jsonschema python3-yaml
 DEB_DEPENDS += python3-venv  # ensurepip
 DEB_DEPENDS += python3-dev python3-pip
 DEB_DEPENDS += libnl-3-dev libnl-route-3-dev libmnl-dev
@@ -79,6 +79,7 @@ DEB_DEPENDS += libelf-dev libpcap-dev # for libxdp (af_xdp)
 DEB_DEPENDS += iperf3 # for 'make test TEST=vcl'
 DEB_DEPENDS += nasm
 DEB_DEPENDS += iperf ethtool  # for 'make test TEST=vm_vpp_interfaces'
+DEB_DEPENDS += libpcap-dev
 
 LIBFFI=libffi6 # works on all but 20.04 and debian-testing
 
@@ -117,7 +118,6 @@ RPM_DEPENDS += numactl-devel
 RPM_DEPENDS += check check-devel
 RPM_DEPENDS += selinux-policy selinux-policy-devel
 RPM_DEPENDS += ninja-build
-RPM_DEPENDS += libuuid-devel
 RPM_DEPENDS += ccache
 RPM_DEPENDS += xmlto
 RPM_DEPENDS += elfutils-libelf-devel libpcap-devel
@@ -175,7 +175,8 @@ RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
 RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
 
 RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel
-RPM_SUSE_DEVEL_DEPS += libopenssl-devel libuuid-devel lsb-release
+RPM_SUSE_DEVEL_DEPS += libopenssl-devel lsb-release
+RPM_SUSE_DEVEL_DEPS += libpcap-devel llvm-devel
 RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel
 
 RPM_SUSE_PYTHON_DEPS = python3-devel python3-pip python3-rpm-macros
@@ -426,13 +427,14 @@ rebuild-release: wipe-release build-release
 export TEST_DIR ?= $(WS_ROOT)/test
 
 define test
-       $(if $(filter-out $(2),retest),make -C $(BR) PLATFORM=vpp TAG=$(1) vpp-install,)
+       $(if $(filter-out $(2),retest),make -C $(BR) PLATFORM=vpp TAG=$(1) CC=$(CC) vpp-install,)
        $(eval libs:=lib lib64)
        make -C test \
          VPP_BUILD_DIR=$(BR)/build-$(1)-native/vpp \
          VPP_BIN=$(BR)/install-$(1)-native/vpp/bin/vpp \
          VPP_INSTALL_PATH=$(BR)/install-$(1)-native/ \
          EXTENDED_TESTS=$(EXTENDED_TESTS) \
+         TEST_GCOV=$(TEST_GCOV) \
          PYTHON=$(PYTHON) \
          OS_ID=$(OS_ID) \
          RND_SEED=$(RND_SEED) \
@@ -449,10 +451,28 @@ test:
 test-debug:
        $(call test,vpp_debug,test)
 
-.PHONY: test-gcov
-test-gcov:
+.PHONY: test-cov
+test-cov:
+       $(eval CC=gcc)
+       $(eval TEST_GCOV=1)
+       $(call test,vpp_gcov,cov)
+
+.PHONY: test-cov-build
+test-cov-build:
+       $(eval CC=gcc)
+       $(eval TEST_GCOV=1)
        $(call test,vpp_gcov,test)
 
+.PHONY: test-cov-prep
+test-cov-prep:
+       $(eval CC=gcc)
+       $(call test,vpp_gcov,cov-prep)
+
+.PHONY: test-cov-post
+test-cov-post:
+       $(eval CC=gcc)
+       $(call test,vpp_gcov,cov-post)
+
 .PHONY: test-all
 test-all:
        $(eval EXTENDED_TESTS=1)
@@ -463,6 +483,13 @@ test-all-debug:
        $(eval EXTENDED_TESTS=1)
        $(call test,vpp_debug,test)
 
+.PHONY: test-all-cov
+test-all-cov:
+       $(eval CC=gcc)
+       $(eval TEST_GCOV=1)
+       $(eval EXTENDED_TESTS=1)
+       $(call test,vpp_gcov,test)
+
 .PHONY: papi-wipe
 papi-wipe: test-wipe-papi
        $(call banner,"This command is deprecated. Please use 'test-wipe-papi'")
@@ -487,8 +514,10 @@ test-shell:
 test-shell-debug:
        $(call test,vpp_debug,shell)
 
-.PHONY: test-shell-gcov
-test-shell-gcov:
+.PHONY: test-shell-cov
+test-shell-cov:
+       $(eval CC=gcc)
+       $(eval TEST_GCOV=1)
        $(call test,vpp_gcov,shell)
 
 .PHONY: test-dep
@@ -505,13 +534,9 @@ test-wipe-doc:
        @echo "make test-wipe-doc is DEPRECATED"
        sleep 300
 
-.PHONY: test-cov
-test-cov:
-       $(eval EXTENDED_TESTS=1)
-       $(call test,vpp_gcov,cov)
-
 .PHONY: test-wipe-cov
 test-wipe-cov:
+       $(call make,$(PLATFORM)_gcov,$(addsuffix -wipe,$(TARGETS)))
        @make -C test wipe-cov
 
 .PHONY: test-wipe-all