From 9fcb1cb0e1bb9cb539fecf8d43f18fb7c07d793a Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 6 Mar 2020 04:08:29 -0500 Subject: [PATCH] build: add option to disable building unit tests If unit tests are not required, add option to disable them. Signed-off-by: Tomasz Zawadzki Change-Id: I387ec043fd47d3033726a51ab673752a521d45c0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1171 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- CONFIG | 5 ++++- Makefile | 2 +- configure | 9 ++++++++- pkg/spdk.spec | 1 + test/Makefile | 5 +++-- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CONFIG b/CONFIG index b8fa8f728..93e0e9783 100644 --- a/CONFIG +++ b/CONFIG @@ -70,9 +70,12 @@ CONFIG_UBSAN=n # Build with Thread Sanitizer enabled CONFIG_TSAN=n -# Build tests +# Build functional tests CONFIG_TESTS=y +# Build unit tests +CONFIG_UNIT_TESTS=y + # Build examples CONFIG_EXAMPLES=y diff --git a/Makefile b/Makefile index e4c645579..ca6e9d602 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ DIRS-y += module DIRS-$(CONFIG_SHARED) += shared_lib DIRS-y += app include DIRS-$(CONFIG_EXAMPLES) += examples -DIRS-$(CONFIG_TESTS) += test +DIRS-y += test DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild DIRS-$(CONFIG_ISAL) += isalbuild diff --git a/configure b/configure index 45acc34d2..21bd4c129 100755 --- a/configure +++ b/configure @@ -32,7 +32,8 @@ function usage() echo " --enable-lto Enable link-time optimization" echo " --enable-pgo-capture Enable generation of profile guided optimization data" echo " --enable-pgo-use Use previously captured profile guided optimization data" - echo " --disable-tests Disable building of tests" + echo " --disable-tests Disable building of functional tests" + echo " --disable-unit-tests Disable building of unit tests" echo " --disable-examples Disable building of examples" echo "" echo "Specifying Dependencies:" @@ -241,6 +242,12 @@ for i in "$@"; do --disable-tests) CONFIG[TESTS]=n ;; + --enable-unit-tests) + CONFIG[UNIT_TESTS]=y + ;; + --disable-unit-tests) + CONFIG[UNIT_TESTS]=n + ;; --enable-examples) CONFIG[EXAMPLES]=y ;; diff --git a/pkg/spdk.spec b/pkg/spdk.spec index 851aa508b..415f6fb44 100644 --- a/pkg/spdk.spec +++ b/pkg/spdk.spec @@ -91,6 +91,7 @@ BuildArch: noarch %build ./configure --prefix=%{_usr} \ --disable-tests \ + --disable-unit-tests \ --without-crypto \ --with-dpdk=/usr/share/dpdk/x86_64-default-linuxapp-gcc \ --without-fio \ diff --git a/test/Makefile b/test/Makefile index 9fcd0801e..ec88de032 100644 --- a/test/Makefile +++ b/test/Makefile @@ -35,9 +35,10 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk # These directories contain tests. -TESTDIRS = app bdev blobfs cpp_headers env event nvme unit rpc_client +TESTDIRS = app bdev blobfs cpp_headers env event nvme rpc_client -DIRS-y = $(TESTDIRS) +DIRS-$(CONFIG_TESTS) += $(TESTDIRS) +DIRS-$(CONFIG_UNIT_TESTS) += unit .PHONY: all clean $(DIRS-y)