From 533039a2355c5c57bfd080829e6580ed6ff616fa Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 30 Nov 2022 16:40:30 +0100 Subject: [PATCH] autobuild: Make autobuild test suite more granular Split each test into its own function. Oncoming patches will expand on this approach. Signed-off-by: Michal Berger Change-Id: I61f3a8847ae65a25504acdf22301757d35c0408d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15722 Tested-by: SPDK CI Jenkins Reviewed-by: Krzysztof Karas Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Kamil Godzwon Reviewed-by: Jim Harris Reviewed-by: Karol Latecki --- test/common/autobuild_common.sh | 47 +++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/test/common/autobuild_common.sh b/test/common/autobuild_common.sh index f81004bf0..6b8b711dc 100755 --- a/test/common/autobuild_common.sh +++ b/test/common/autobuild_common.sh @@ -283,7 +283,7 @@ test_make_uninstall() { fi } -build_doc() { +_build_doc() { local doxygenv doxygenv=$(doxygen --version) @@ -326,19 +326,44 @@ build_doc() { rm -rf "$rootdir"/doc/output } -autobuild_test_suite() { +check_format() { run_test "autobuild_check_format" "$rootdir/scripts/check_format.sh" - run_test "autobuild_check_so_deps" $rootdir/test/make/check_so_deps.sh $1 +} + +check_so_deps() { + run_test "autobuild_check_so_deps" "$rootdir/test/make/check_so_deps.sh" "$1" +} + +external_code() { + run_test "autobuild_external_code" "$rootdir/test/external_code/test_make.sh" "$rootdir" +} + +dpdk_pci_api() { run_test "autobuild_check_dpdk_pci_api" check_dpdk_pci_api +} + +build_files() { + "$rootdir/configure" $config_params --without-shared + $MAKE $MAKEFLAGS + run_test "autobuild_generated_files_check" porcelain_check + run_test "autobuild_header_dependency_check" header_dependency_check + run_test "autobuild_make_install" test_make_install + run_test "autobuild_make_uninstall" test_make_uninstall +} + +build_doc() { + "$rootdir/configure" $config_params --without-shared + run_test "autobuild_build_doc" _build_doc +} + +autobuild_test_suite() { + check_format + check_so_deps "$1" + dpdk_pci_api if [[ $SPDK_TEST_AUTOBUILD == 'full' ]]; then - run_test "autobuild_external_code" $rootdir/test/external_code/test_make.sh $rootdir - "$rootdir/configure" $config_params --without-shared - $MAKE $MAKEFLAGS - run_test "autobuild_generated_files_check" porcelain_check - run_test "autobuild_header_dependency_check" header_dependency_check - run_test "autobuild_make_install" test_make_install - run_test "autobuild_make_uninstall" test_make_uninstall - run_test "autobuild_build_doc" build_doc + external_code + build_files + build_doc fi }