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:
parent
34f53ab7cc
commit
9fcb1cb0e1
5
CONFIG
5
CONFIG
@ -70,9 +70,12 @@ CONFIG_UBSAN=n
|
|||||||
# Build with Thread Sanitizer enabled
|
# Build with Thread Sanitizer enabled
|
||||||
CONFIG_TSAN=n
|
CONFIG_TSAN=n
|
||||||
|
|
||||||
# Build tests
|
# Build functional tests
|
||||||
CONFIG_TESTS=y
|
CONFIG_TESTS=y
|
||||||
|
|
||||||
|
# Build unit tests
|
||||||
|
CONFIG_UNIT_TESTS=y
|
||||||
|
|
||||||
# Build examples
|
# Build examples
|
||||||
CONFIG_EXAMPLES=y
|
CONFIG_EXAMPLES=y
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@ -41,7 +41,7 @@ DIRS-y += module
|
|||||||
DIRS-$(CONFIG_SHARED) += shared_lib
|
DIRS-$(CONFIG_SHARED) += shared_lib
|
||||||
DIRS-y += app include
|
DIRS-y += app include
|
||||||
DIRS-$(CONFIG_EXAMPLES) += examples
|
DIRS-$(CONFIG_EXAMPLES) += examples
|
||||||
DIRS-$(CONFIG_TESTS) += test
|
DIRS-y += test
|
||||||
DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild
|
DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild
|
||||||
DIRS-$(CONFIG_ISAL) += isalbuild
|
DIRS-$(CONFIG_ISAL) += isalbuild
|
||||||
|
|
||||||
|
9
configure
vendored
9
configure
vendored
@ -32,7 +32,8 @@ function usage()
|
|||||||
echo " --enable-lto Enable link-time optimization"
|
echo " --enable-lto Enable link-time optimization"
|
||||||
echo " --enable-pgo-capture Enable generation of profile guided optimization data"
|
echo " --enable-pgo-capture Enable generation of profile guided optimization data"
|
||||||
echo " --enable-pgo-use Use previously captured 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 " --disable-examples Disable building of examples"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Specifying Dependencies:"
|
echo "Specifying Dependencies:"
|
||||||
@ -241,6 +242,12 @@ for i in "$@"; do
|
|||||||
--disable-tests)
|
--disable-tests)
|
||||||
CONFIG[TESTS]=n
|
CONFIG[TESTS]=n
|
||||||
;;
|
;;
|
||||||
|
--enable-unit-tests)
|
||||||
|
CONFIG[UNIT_TESTS]=y
|
||||||
|
;;
|
||||||
|
--disable-unit-tests)
|
||||||
|
CONFIG[UNIT_TESTS]=n
|
||||||
|
;;
|
||||||
--enable-examples)
|
--enable-examples)
|
||||||
CONFIG[EXAMPLES]=y
|
CONFIG[EXAMPLES]=y
|
||||||
;;
|
;;
|
||||||
|
@ -91,6 +91,7 @@ BuildArch: noarch
|
|||||||
%build
|
%build
|
||||||
./configure --prefix=%{_usr} \
|
./configure --prefix=%{_usr} \
|
||||||
--disable-tests \
|
--disable-tests \
|
||||||
|
--disable-unit-tests \
|
||||||
--without-crypto \
|
--without-crypto \
|
||||||
--with-dpdk=/usr/share/dpdk/x86_64-default-linuxapp-gcc \
|
--with-dpdk=/usr/share/dpdk/x86_64-default-linuxapp-gcc \
|
||||||
--without-fio \
|
--without-fio \
|
||||||
|
@ -35,9 +35,10 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
|
|||||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||||
|
|
||||||
# These directories contain tests.
|
# 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)
|
.PHONY: all clean $(DIRS-y)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user