autobuild: Create wrappers around top test suites

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia2791e357a7156adfa323c00f54b5ff356f0edf5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15726
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
This commit is contained in:
Michal Berger 2022-11-30 17:22:13 +01:00 committed by Tomasz Zawadzki
parent 1d563b2d2a
commit 58ac71a4df
2 changed files with 36 additions and 12 deletions

View File

@ -26,7 +26,7 @@ if [ $SPDK_RUN_UBSAN -eq 1 ]; then
fi fi
if [ -n "$SPDK_TEST_NATIVE_DPDK" ]; then if [ -n "$SPDK_TEST_NATIVE_DPDK" ]; then
run_test "build_native_dpdk" build_native_dpdk build_native_dpdk
fi fi
case "$SPDK_TEST_AUTOBUILD" in case "$SPDK_TEST_AUTOBUILD" in
@ -46,19 +46,19 @@ case "$SPDK_TEST_AUTOBUILD" in
esac esac
if [[ $SPDK_TEST_OCF -eq 1 ]]; then if [[ $SPDK_TEST_OCF -eq 1 ]]; then
run_test "autobuild_ocf_precompile" ocf_precompile ocf_precompile
fi fi
if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then
run_test "autobuild_llvm_precompile" llvm_precompile llvm_precompile
fi fi
if [[ -n $SPDK_TEST_AUTOBUILD ]]; then if [[ -n $SPDK_TEST_AUTOBUILD ]]; then
run_test "autobuild" autobuild_test_suite autobuild_test_suite
elif [[ $SPDK_TEST_UNITTEST -eq 1 ]]; then elif [[ $SPDK_TEST_UNITTEST -eq 1 ]]; then
run_test "unittest_build" unittest_build unittest_build
elif [[ $SPDK_TEST_SCANBUILD -eq 1 ]]; then elif [[ $SPDK_TEST_SCANBUILD -eq 1 ]]; then
run_test "scanbuild_make" scanbuild_make scanbuild_make
else else
if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then
# if we are testing nvmf fuzz with llvm lib, --with-shared will cause lib link fail # if we are testing nvmf fuzz with llvm lib, --with-shared will cause lib link fail

View File

@ -6,7 +6,7 @@
source "$rootdir/test/common/autotest_common.sh" source "$rootdir/test/common/autotest_common.sh"
source "$rootdir/scripts/common.sh" source "$rootdir/scripts/common.sh"
ocf_precompile() { _ocf_precompile() {
# We compile OCF sources ourselves # We compile OCF sources ourselves
# They don't need to be checked with scanbuild and code coverage is not applicable # 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 # 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 # Find matching llvm fuzzer library and clang compiler version
llvm_precompile() { _llvm_precompile() {
[[ $(clang --version) =~ "version "(([0-9]+).([0-9]+).([0-9]+)) ]] [[ $(clang --version) =~ "version "(([0-9]+).([0-9]+).([0-9]+)) ]]
clang_version=${BASH_REMATCH[1]} clang_version=${BASH_REMATCH[1]}
clang_num=${BASH_REMATCH[2]} clang_num=${BASH_REMATCH[2]}
@ -37,7 +37,7 @@ llvm_precompile() {
"$rootdir/configure" $config_params "$rootdir/configure" $config_params
} }
build_native_dpdk() { _build_native_dpdk() {
local external_dpdk_dir local external_dpdk_dir
local external_dpdk_base_dir local external_dpdk_base_dir
local compiler_version local compiler_version
@ -203,7 +203,7 @@ make_fail_cleanup() {
false false
} }
scanbuild_make() { _scanbuild_make() {
pass=true pass=true
"$rootdir/configure" $config_params --without-shared "$rootdir/configure" $config_params --without-shared
$scanbuild $MAKE $MAKEFLAGS > $out/build_output.txt && rm -rf $out/scan-build-tmp || make_fail_cleanup $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 build_doc
} }
autobuild_test_suite() { _autobuild_test_suite() {
case "$SPDK_TEST_AUTOBUILD" in case "$SPDK_TEST_AUTOBUILD" in
tiny) autobuild_test_suite_tiny ;; tiny) autobuild_test_suite_tiny ;;
ext) autobuild_test_suite_ext ;; ext) autobuild_test_suite_ext ;;
@ -381,11 +381,35 @@ autobuild_test_suite() {
esac esac
} }
unittest_build() { _unittest_build() {
"$rootdir/configure" $config_params --without-shared "$rootdir/configure" $config_params --without-shared
$MAKE $MAKEFLAGS $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 out=$output_dir
SPDK_WORKSPACE=$(mktemp -dt "spdk_$(date +%s).XXXXXX") SPDK_WORKSPACE=$(mktemp -dt "spdk_$(date +%s).XXXXXX")