From 58ac71a4df4ba4fae0408229be66b86d52fac7af Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 30 Nov 2022 17:22:13 +0100 Subject: [PATCH] autobuild: Create wrappers around top test suites Signed-off-by: Michal Berger Change-Id: Ia2791e357a7156adfa323c00f54b5ff356f0edf5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15726 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Kamil Godzwon --- autobuild.sh | 12 +++++------ test/common/autobuild_common.sh | 36 +++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 10550f11e..68dbda74d 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -26,7 +26,7 @@ if [ $SPDK_RUN_UBSAN -eq 1 ]; then fi if [ -n "$SPDK_TEST_NATIVE_DPDK" ]; then - run_test "build_native_dpdk" build_native_dpdk + build_native_dpdk fi case "$SPDK_TEST_AUTOBUILD" in @@ -46,19 +46,19 @@ case "$SPDK_TEST_AUTOBUILD" in esac if [[ $SPDK_TEST_OCF -eq 1 ]]; then - run_test "autobuild_ocf_precompile" ocf_precompile + ocf_precompile fi if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then - run_test "autobuild_llvm_precompile" llvm_precompile + llvm_precompile fi if [[ -n $SPDK_TEST_AUTOBUILD ]]; then - run_test "autobuild" autobuild_test_suite + autobuild_test_suite elif [[ $SPDK_TEST_UNITTEST -eq 1 ]]; then - run_test "unittest_build" unittest_build + unittest_build elif [[ $SPDK_TEST_SCANBUILD -eq 1 ]]; then - run_test "scanbuild_make" scanbuild_make + scanbuild_make else if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then # if we are testing nvmf fuzz with llvm lib, --with-shared will cause lib link fail diff --git a/test/common/autobuild_common.sh b/test/common/autobuild_common.sh index 64960bf70..92b4d8495 100755 --- a/test/common/autobuild_common.sh +++ b/test/common/autobuild_common.sh @@ -6,7 +6,7 @@ source "$rootdir/test/common/autotest_common.sh" source "$rootdir/scripts/common.sh" -ocf_precompile() { +_ocf_precompile() { # We compile OCF sources ourselves # They don't need to be checked with scanbuild and code coverage is not applicable # So we precompile OCF now for further use as standalone static library @@ -20,7 +20,7 @@ ocf_precompile() { } # Find matching llvm fuzzer library and clang compiler version -llvm_precompile() { +_llvm_precompile() { [[ $(clang --version) =~ "version "(([0-9]+).([0-9]+).([0-9]+)) ]] clang_version=${BASH_REMATCH[1]} clang_num=${BASH_REMATCH[2]} @@ -37,7 +37,7 @@ llvm_precompile() { "$rootdir/configure" $config_params } -build_native_dpdk() { +_build_native_dpdk() { local external_dpdk_dir local external_dpdk_base_dir local compiler_version @@ -203,7 +203,7 @@ make_fail_cleanup() { false } -scanbuild_make() { +_scanbuild_make() { pass=true "$rootdir/configure" $config_params --without-shared $scanbuild $MAKE $MAKEFLAGS > $out/build_output.txt && rm -rf $out/scan-build-tmp || make_fail_cleanup @@ -373,7 +373,7 @@ autobuild_test_suite_full() { build_doc } -autobuild_test_suite() { +_autobuild_test_suite() { case "$SPDK_TEST_AUTOBUILD" in tiny) autobuild_test_suite_tiny ;; ext) autobuild_test_suite_ext ;; @@ -381,11 +381,35 @@ autobuild_test_suite() { esac } -unittest_build() { +_unittest_build() { "$rootdir/configure" $config_params --without-shared $MAKE $MAKEFLAGS } +autobuild_test_suite() { + run_test "autobuild" _autobuild_test_suite +} + +unittest_build() { + run_test "unittest_build" _unittest_build +} + +scanbuild_make() { + run_test "scanbuild_make" _scanbuild_make +} + +ocf_precompile() { + run_test "autobuild_ocf_precompile" _ocf_precompile +} + +llvm_precompile() { + run_test "autobuild_llvm_precompile" _llvm_precompile +} + +build_native_dpdk() { + run_test "build_native_dpdk" _build_native_dpdk +} + out=$output_dir SPDK_WORKSPACE=$(mktemp -dt "spdk_$(date +%s).XXXXXX")