From e7e329e70b93147ea918e48bd3fc16cbaa665e5d Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Tue, 14 Apr 2026 10:12:44 +0100 Subject: [PATCH] test: reorder if-else structure Signed-off-by: Yi Wu --- tests/scripts/components-build-system.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/scripts/components-build-system.sh b/tests/scripts/components-build-system.sh index 63a708675e..26aa70a770 100644 --- a/tests/scripts/components-build-system.sh +++ b/tests/scripts/components-build-system.sh @@ -222,7 +222,14 @@ component_test_cmake_install_with_destdir () { install_lib_path="$OUT_OF_SOURCE_DIR/stage/usr/${install_lib_subdir}" - if [[ "$OSTYPE" != darwin* ]]; then + if [[ "$OSTYPE" == darwin* ]]; then + # On macOS the custom install logic installs libmbedcrypto.dylib + # directly without a versioned symlink chain. + for lib in tfpsacrypto mbedcrypto mbedx509 mbedtls; do + [ -f "$install_lib_path/lib${lib}.a" ] + [ -e "$install_lib_path/lib${lib}.dylib" ] + done + else # library/CMakeLists.txt installs libmbedcrypto.so with a versioned # symlink chain on Linux. for lib in tfpsacrypto mbedcrypto mbedx509 mbedtls; do @@ -236,19 +243,10 @@ component_test_cmake_install_with_destdir () { if [ "$QUIET" -eq 0 ]; then declare -p versioned fi - [ "${#versioned[@]}" -ge 1 ] - # [ -L "${versioned[0]}" ] + # [ "${#versioned[@]}" -ge 1 ] + [ -L "${versioned[0]}" ] [ -e "${versioned[0]}" ] done - elif [[ "$OSTYPE" == darwin* ]]; then - # On macOS the custom install logic installs libmbedcrypto.dylib - # directly without a versioned symlink chain. - for lib in tfpsacrypto mbedcrypto mbedx509 mbedtls; do - [ -f "$install_lib_path/lib${lib}.a" ] - [ -e "$install_lib_path/lib${lib}.dylib" ] - done - else - echo "Unsupported platform for DESTDIR shared library checks" fi }