build: add option to disable building unit tests

If unit tests are not required, add option to disable them.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I387ec043fd47d3033726a51ab673752a521d45c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1171
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Tomasz Zawadzki 2020-03-06 04:08:29 -05:00
parent 34f53ab7cc
commit 9fcb1cb0e1
5 changed files with 17 additions and 5 deletions

5
CONFIG
View File

@ -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

View File

@ -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

9
configure vendored
View File

@ -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
;;

View File

@ -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 \

View File

@ -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)