From 79c28aa698e9ca08ca8ec91c3d2d3ac314a543fe Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 6 Mar 2020 04:28:51 -0500 Subject: [PATCH] test/build: disable compiling unused components in tests This patch decreases the compile time when particular test category is not executed by tests. Added skipping the 'examples' dir during verification of scanbuild scanned files. Only when examples were not compiled. Signed-off-by: Tomasz Zawadzki Change-Id: I41e7b9d18913fd02e2b6cbe44f933ab2e0371d28 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1172 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Paul Luse --- autobuild.sh | 1 + test/common/autotest_common.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/autobuild.sh b/autobuild.sh index 3e2e3110f..c285817f9 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -60,6 +60,7 @@ function scanbuild_make { xtrace_disable for ent in $(find app examples lib module -type f | grep -vF ".h"); do if [[ $ent == lib/env_ocf* ]]; then continue; fi + if [[ SPDK_RUN_FUNCTIONAL_TEST -eq 0 && $ent == examples* ]]; then continue; fi if file -bi $ent | grep -q 'text/x-c'; then echo $ent | sed 's/\.cp\{0,2\}$//g' >> $out/all_c_files.txt fi diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 4114f9419..98077e9a7 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -193,6 +193,15 @@ if [ -d /usr/include/iscsi ]; then fi fi +if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 0 ]; then + config_params+=' --disable-tests' + config_params+=' --disable-examples' +fi + +if [ $SPDK_TEST_UNITTEST -eq 0 ]; then + config_params+=' --disable-unit-tests' +fi + if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then config_params+=' --with-nvme-cuse' fi