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 <tomasz.zawadzki@intel.com>
Change-Id: I41e7b9d18913fd02e2b6cbe44f933ab2e0371d28
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1172
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Tomasz Zawadzki 2020-03-06 04:28:51 -05:00
parent 9ba4bb22fe
commit 79c28aa698
2 changed files with 10 additions and 0 deletions

View File

@ -60,6 +60,7 @@ function scanbuild_make {
xtrace_disable xtrace_disable
for ent in $(find app examples lib module -type f | grep -vF ".h"); do for ent in $(find app examples lib module -type f | grep -vF ".h"); do
if [[ $ent == lib/env_ocf* ]]; then continue; fi 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 if file -bi $ent | grep -q 'text/x-c'; then
echo $ent | sed 's/\.cp\{0,2\}$//g' >> $out/all_c_files.txt echo $ent | sed 's/\.cp\{0,2\}$//g' >> $out/all_c_files.txt
fi fi

View File

@ -193,6 +193,15 @@ if [ -d /usr/include/iscsi ]; then
fi fi
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 if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then
config_params+=' --with-nvme-cuse' config_params+=' --with-nvme-cuse'
fi fi