diff --git a/autobuild.sh b/autobuild.sh index e3e85b341..c4f218992 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -54,6 +54,27 @@ function make_fail_cleanup { false } +function scanbuild_make { + pass=true + $scanbuild $MAKE $MAKEFLAGS > $out/build_output.txt && rm -rf $out/scan-build-tmp || make_fail_cleanup + for ent in $(find app examples lib module -type f | grep -vF ".h"); do + if file -bi $ent | grep -q 'text/x-c'; then + echo $ent | sed 's/\.cp\{0,2\}$//g' >> $out/all_c_files.txt + fi + done + + sed -n '/Leaving directory /,$p' $out/build_output.txt | grep -E "CC|CXX" | sed 's/\s\s\(CC\|CXX\)\s//g' | sed 's/\.o//g' > $out/built_c_files.txt + paste -d '\n' $out/all_c_files.txt $out/built_c_files.txt $rootdir/test/common/skipped_build_files.txt | grep -vE "^test|lib/env_ocf|#" | sort | uniq -u > $out/unbuilt_c_files.txt + + if [ $(wc -l < $out/unbuilt_c_files.txt) -ge 1 ]; then + echo "missing files" + cat $out/unbuilt_c_files.txt + pass=false + fi + + $pass +} + function porcelain_check { if [ $(git status --porcelain --ignore-submodules | wc -l) -ne 0 ]; then echo "Generated files missing from .gitignore:" @@ -117,7 +138,7 @@ function build_doc { function autobuild_test_suite { run_test "autobuild_check_format" ./scripts/check_format.sh run_test "autobuild_check_so_deps" $rootdir/test/make/check_so_deps.sh - run_test "scanbuild_make" $scanbuild $MAKE $MAKEFLAGS && rm -rf $out/scan-build-tmp || make_fail_cleanup + run_test "scanbuild_make" scanbuild_make run_test "autobuild_generated_files_check" porcelain_check run_test "autobuild_header_dependency_check" header_dependency_check run_test "autobuild_make_install" $MAKE $MAKEFLAGS install DESTDIR=/tmp/spdk prefix=/usr diff --git a/test/common/skipped_build_files.txt b/test/common/skipped_build_files.txt new file mode 100644 index 000000000..1d138623a --- /dev/null +++ b/test/common/skipped_build_files.txt @@ -0,0 +1,34 @@ +# Not configured to test vtune. +lib/bdev/vtune + +# Not configured to test VPP +module/sock/vpp/vpp + +# Not configured to test rocksdb env file +lib/rocksdb/env_spdk.cc + +# Not configured to test FC +lib/nvmf/fc +lib/nvmf/fc_ls + +# Not configured for Neon testing +lib/util/base64_neon + +# Files related to testing our internal vhost implementation. +lib/rte_vhost/fd_man +lib/rte_vhost/socket +lib/rte_vhost/vhost +lib/rte_vhost/vhost_user +lib/vhost/vhost_nvme +lib/virtio/virtio_user/vhost_user + +# Cuse related files, enable when ready. +lib/nvme/nvme_cuse +module/bdev/nvme/bdev_nvme_cuse_rpc + +# Currently we don't have this plumbed for testing, enable when ready. +module/bdev/uring/bdev_uring +module/bdev/uring/bdev_uring_rpc + +# Currently not testing blobfs_fuse, enable when ready. +module/blobfs/bdev/blobfs_fuse