diff --git a/CONFIG b/CONFIG index 28f4ab0e8b..951aa21585 100644 --- a/CONFIG +++ b/CONFIG @@ -55,6 +55,9 @@ CONFIG_UBSAN?=n # Build with Thread Sanitizer enabled CONFIG_TSAN?=n +# Build tests +CONFIG_TESTS?=y + # Directory that contains the desired SPDK environment library. # By default, this is implemented using DPDK. CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk diff --git a/Makefile b/Makefile index e7d2d547e0..25b1fbab85 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,8 @@ S := SPDK_ROOT_DIR := $(CURDIR) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y += lib test examples app include +DIRS-y += lib examples app include +DIRS-$(CONFIG_TESTS) += test .PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk cc_version cxx_version diff --git a/configure b/configure index 1531ca34c3..6804bfc33b 100755 --- a/configure +++ b/configure @@ -21,6 +21,7 @@ function usage() echo " --enable-ubsan Enable undefined behavior sanitizer" echo " --enable-coverage Enable code coverage tracking" echo " --enable-lto Enable link-time optimization" + echo " --disable-tests Disable building of tests" echo " --with-env=path Use an alternate environment implementation" echo "" echo "Specifying Dependencies:" @@ -101,6 +102,12 @@ for i in "$@"; do --disable-lto) CONFIG_LTO=n ;; + --enable-tests) + CONFIG_TESTS=y + ;; + --disable-tests) + CONFIG_TESTS=n + ;; --enable-werror) CONFIG_WERROR=y ;; @@ -233,6 +240,9 @@ fi if [ -n "$CONFIG_LTO" ]; then echo "CONFIG_LTO?=$CONFIG_LTO" >> CONFIG.local fi +if [ -n "$CONFIG_TESTS" ]; then + echo "CONFIG_TESTS?=$CONFIG_TESTS" >> CONFIG.local +fi if [ -n "$CONFIG_ASAN" ]; then echo "CONFIG_ASAN?=$CONFIG_ASAN" >> CONFIG.local fi