From 23a6432af1e8b156b2da1ce1c3d246387e2a5558 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Thu, 7 Nov 2024 14:38:54 +0000 Subject: [PATCH 1/4] Add project and branch detection in shell Signed-off-by: Elena Uziunaite --- framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework b/framework index f1119c2e80..c3cee628f5 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit f1119c2e80d0a3ce1260fbf3714f5955b4abd026 +Subproject commit c3cee628f52aab5b9b2a617f2e594683122014f3 From ef40183c342e5125b3a6d1fea737e1860898e79f Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Thu, 7 Nov 2024 14:39:32 +0000 Subject: [PATCH 2/4] Use new functions Signed-off-by: Elena Uziunaite --- scripts/lcov.sh | 11 +---------- tests/scripts/check-generated-files.sh | 8 +------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/scripts/lcov.sh b/scripts/lcov.sh index 79c5c9fd28..2b650f1338 100755 --- a/scripts/lcov.sh +++ b/scripts/lcov.sh @@ -30,16 +30,7 @@ EOF set -eu -# Project detection -PROJECT_NAME_FILE='./scripts/project_name.txt' -if read -r PROJECT_NAME < "$PROJECT_NAME_FILE"; then :; else - echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2 - exit 1 -fi - -in_mbedtls_repo () { - test "$PROJECT_NAME" = "Mbed TLS" -} +. ../framework/scripts/project_detection.sh # Collect stats and build a HTML report. lcov_library_report () { diff --git a/tests/scripts/check-generated-files.sh b/tests/scripts/check-generated-files.sh index 35990d0db2..865e24777d 100755 --- a/tests/scripts/check-generated-files.sh +++ b/tests/scripts/check-generated-files.sh @@ -22,13 +22,7 @@ EOF exit fi -in_mbedtls_repo () { - test -d include -a -d library -a -d programs -a -d tests -} - -in_tf_psa_crypto_repo () { - test -d include -a -d core -a -d drivers -a -d programs -a -d tests -} +. framework/scripts/project_detection.sh if in_mbedtls_repo; then if [ -d tf-psa-crypto ]; then From 2e37806ace2c1e585fc160b48ed7ad4bd0280a00 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Tue, 12 Nov 2024 16:16:05 +0000 Subject: [PATCH 3/4] Fix paths Signed-off-by: Elena Uziunaite --- scripts/lcov.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/lcov.sh b/scripts/lcov.sh index 2b650f1338..60fce6cbc2 100755 --- a/scripts/lcov.sh +++ b/scripts/lcov.sh @@ -28,9 +28,11 @@ EOF # Copyright The Mbed TLS Contributors # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# This script must be invoked from the project's root. + set -eu -. ../framework/scripts/project_detection.sh +. framework/scripts/project_detection.sh # Collect stats and build a HTML report. lcov_library_report () { From 8993fecae47ec5b7c2853c3f2c654213e12a97bf Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Wed, 20 Nov 2024 16:28:01 +0000 Subject: [PATCH 4/4] Define FRAMEWORK Signed-off-by: Elena Uziunaite --- tests/scripts/mbedtls-all.sh | 3 ++- tf-psa-crypto/tests/scripts/all.sh | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/scripts/mbedtls-all.sh b/tests/scripts/mbedtls-all.sh index a1b062aac8..089cb6b9e0 100755 --- a/tests/scripts/mbedtls-all.sh +++ b/tests/scripts/mbedtls-all.sh @@ -10,6 +10,7 @@ # This script must be invoked from the project's root. -source framework/scripts/all-core.sh +FRAMEWORK="$PWD/framework" +source $FRAMEWORK/scripts/all-core.sh main "$@" diff --git a/tf-psa-crypto/tests/scripts/all.sh b/tf-psa-crypto/tests/scripts/all.sh index 86b06099d1..9c7547b8be 100755 --- a/tf-psa-crypto/tests/scripts/all.sh +++ b/tf-psa-crypto/tests/scripts/all.sh @@ -19,10 +19,12 @@ fi if [ -d ../include/mbedtls -a -d ../framework ]; then # Running inside an mbedtls checkout: get the framework from mbedtls. - source ../framework/scripts/all-core.sh + FRAMEWORK="$PWD/../framework" else # Running standalone: use our own framework. - source framework/scripts/all-core.sh + FRAMEWORK="$PWD/framework" fi +source $FRAMEWORK/scripts/all-core.sh + main "$@"