diff mbox

[dpdk-dev,2/4] mk: do not build tests by default

Message ID 20170215152632.25081-2-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Ferruh Yigit Feb. 15, 2017, 3:26 p.m. UTC
Don't build tests with default "make" command.

Require explicit command to build tests because not everybody interested
in running unit tests.

Following changes done in make rules:
"make test-build"  <--- Added
"make test"        <--- Updated functionality (build + run)

Now "make test" builds all tests and runs unit test (test).

Because of dependency resolving, it is possible to call "make test"
directly after config, "make test" will compile dependent components
(lib and drivers, but not apps).

And a new "make test-build" make rule added which will build
tests but not run unit test. "make test-build" has same dependency
resolving features with "make test"

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 GNUmakefile          | 2 +-
 mk/rte.sdkbuild.mk   | 6 +++---
 mk/rte.sdkdepdirs.mk | 2 +-
 mk/rte.sdkroot.mk    | 7 +++++++
 4 files changed, 12 insertions(+), 5 deletions(-)

Comments

Thomas Monjalon Feb. 15, 2017, 4:58 p.m. UTC | #1
2017-02-15 15:26, Ferruh Yigit:
> +.PHONY: test-buid
> +test-build:
> +	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk checkconfig
> +	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkbuild.mk test

Why not rely on default rule below?

# all other build targets
%:
    $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk checkconfig
    $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkbuild.mk $@
diff mbox

Patch

diff --git a/GNUmakefile b/GNUmakefile
index b1a5b76..00fe0db 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -40,6 +40,6 @@  export RTE_SDK
 # directory list
 #
 
-ROOTDIRS-y := buildtools lib drivers app test
+ROOTDIRS-y := buildtools lib drivers app
 
 include $(RTE_SDK)/mk/rte.sdkroot.mk
diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk
index db6b983..21e0a47 100644
--- a/mk/rte.sdkbuild.mk
+++ b/mk/rte.sdkbuild.mk
@@ -48,7 +48,7 @@  define depdirs_rule
 $(1): $(sort $(LOCAL_DEPDIRS-$(1)))
 endef
 
-$(foreach d,$(ROOTDIRS-y),$(eval $(call depdirs_rule,$(d))))
+$(foreach d,$(ROOTDIRS-y) test,$(eval $(call depdirs_rule,$(d))))
 drivers: | buildtools
 
 #
@@ -73,8 +73,8 @@  clean: $(CLEANDIRS)
 	@echo Clean complete
 
 .SECONDEXPANSION:
-.PHONY: $(ROOTDIRS-y)
-$(ROOTDIRS-y):
+.PHONY: $(ROOTDIRS-y) test
+$(ROOTDIRS-y) test:
 	@[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
 	@echo "== Build $@"
 	$(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
diff --git a/mk/rte.sdkdepdirs.mk b/mk/rte.sdkdepdirs.mk
index 38fd863..f82db69 100644
--- a/mk/rte.sdkdepdirs.mk
+++ b/mk/rte.sdkdepdirs.mk
@@ -36,7 +36,7 @@  ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
   $(error "need a make config first")
 endif
 
-DEPDIR_FILES = $(addsuffix /.depdirs, $(addprefix $(BUILDDIR)/,$(ROOTDIRS-y)))
+DEPDIR_FILES = $(addsuffix /.depdirs, $(addprefix $(BUILDDIR)/,$(ROOTDIRS-y) test))
 
 .PHONY: depdirs
 depdirs: $(RTE_OUTPUT)/.depdirs
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 04ad523..9c23987 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -96,6 +96,13 @@  config showconfigs showversion showversionum:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
+test: test-build
+
+.PHONY: test-buid
+test-build:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk checkconfig
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkbuild.mk test
+
 .PHONY: install
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install