build: fix 'make test' target to build with clang

- gmake set CC=cc as the default therefore the test/test-debug
  makefile targets will build using gcc (cc == gcc for debian/ubuntu
  distros) unless set explicitly to clang due to use of 'CC=$(CC)' in
  test macro.

  Note: the CI builds vpp images prior to running 'make test', thus
  the CI does test vpp built using clang.  This basically makes local
  runs of 'make test' build using clang as well.

Type: make

Change-Id: I7221098c200be23b53bb616e41a42a6d65a03699
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
This commit is contained in:
Dave Wallace
2023-12-20 20:02:45 -05:00
committed by Damjan Marion
parent 95f07a16ae
commit ccc17f0a70

View File

@ -448,10 +448,16 @@ endef
.PHONY: test
test:
ifeq ($(CC),cc)
$(eval CC=clang)
endif
$(call test,vpp,test)
.PHONY: test-debug
test-debug:
ifeq ($(CC),cc)
$(eval CC=clang)
endif
$(call test,vpp_debug,test)
.PHONY: test-cov