Commit 606ba0c3 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

test/build: add test directory to scanbuild verification



scanbuild_make verifies if all files in repository were
scanned by scanbuild. 'test' directory was not part of this
check, even though it contains C files with applications
used during tests.

This change does not affect what gets, and what does not
scanned by scanbuild. Only what we verify that was.
It will help to spot any files accidentally skipped.

This patch adds 'test' directory to the check.
Along with skipping directories when not compiled with:
- Functional tests disabled - don't check 'test', but still check 'test/unit'
- Unit tests disabled - don't check 'test/unit'

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I01e16de83827022c412a57df379280bfed671797
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1212


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 79c28aa6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -58,9 +58,11 @@ function scanbuild_make {
	pass=true
	$scanbuild $MAKE $MAKEFLAGS > $out/build_output.txt && rm -rf $out/scan-build-tmp || make_fail_cleanup
	xtrace_disable
	for ent in $(find app examples lib module -type f | grep -vF ".h"); do
	for ent in $(find app examples lib module test -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 [[ SPDK_RUN_FUNCTIONAL_TEST -eq 0 && $ent == test* && $end != test/unit* ]]; then continue; fi
		if [[ SPDK_TEST_UNITTEST -eq 0 && $end == test/unit* ]]; 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