From 381247eda52b8fc7e43f628338c5d62b401d2cc5 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 2 Jul 2024 09:55:39 +0200 Subject: [PATCH] Adapt check-generated-files.sh Signed-off-by: Ronald Cron --- framework | 2 +- scripts/generate_driver_wrappers.py | 4 ++-- tests/scripts/check-generated-files.sh | 18 +++++++++++++----- tests/scripts/test_psa_compliance.py | 9 ++++++++- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/framework b/framework index 8853c84712..17d3392189 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 8853c8471200e62448413d1f40d6801a19796a83 +Subproject commit 17d3392189bc3e17e63cc7856cce99b4e2382993 diff --git a/scripts/generate_driver_wrappers.py b/scripts/generate_driver_wrappers.py index 0f0c8c7be1..9579764045 100755 --- a/scripts/generate_driver_wrappers.py +++ b/scripts/generate_driver_wrappers.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -"""Generate library/psa_crypto_driver_wrappers.h - library/psa_crypto_driver_wrappers_no_static.c +"""Generate psa_crypto_driver_wrappers.h + psa_crypto_driver_wrappers_no_static.c This module is invoked by the build scripts to auto generate the psa_crypto_driver_wrappers.h and psa_crypto_driver_wrappers_no_static diff --git a/tests/scripts/check-generated-files.sh b/tests/scripts/check-generated-files.sh index 09c850af7a..56d4884c50 100755 --- a/tests/scripts/check-generated-files.sh +++ b/tests/scripts/check-generated-files.sh @@ -31,9 +31,16 @@ in_tf_psa_crypto_repo () { } if in_mbedtls_repo; then - library_dir='library' + if [ -d tf-psa-crypto ]; then + crypto_core_dir='tf-psa-crypto/core' + builtin_drivers_dir='tf-psa-crypto/drivers/builtin/src' + else + crypto_core_dir='library' + builtin_drivers_dir='library' + fi elif in_tf_psa_crypto_repo; then - library_dir='core' + crypto_core_dir='core' + builtin_drivers_dir='drivers/builtin/src/' else echo "Must be run from Mbed TLS root or TF-PSA-Crypto root" >&2 exit 1 @@ -133,13 +140,14 @@ check framework/scripts/generate_config_tests.py $(framework/scripts/generate_co check framework/scripts/generate_ecp_tests.py $(framework/scripts/generate_ecp_tests.py --list) check framework/scripts/generate_psa_tests.py $(framework/scripts/generate_psa_tests.py --list) check framework/scripts/generate_test_keys.py tests/src/test_keys.h -check scripts/generate_driver_wrappers.py $library_dir/psa_crypto_driver_wrappers.h $library_dir/psa_crypto_driver_wrappers_no_static.c +check scripts/generate_driver_wrappers.py ${crypto_core_dir}/psa_crypto_driver_wrappers.h \ + ${crypto_core_dir}/psa_crypto_driver_wrappers_no_static.c # Additional checks for Mbed TLS only if in_mbedtls_repo; then - check scripts/generate_errors.pl library/error.c + check scripts/generate_errors.pl ${builtin_drivers_dir}/error.c check scripts/generate_query_config.pl programs/test/query_config.c - check scripts/generate_features.pl library/version_features.c + check scripts/generate_features.pl ${builtin_drivers_dir}/version_features.c check scripts/generate_ssl_debug_helpers.py library/ssl_debug_helpers_generated.c check framework/scripts/generate_test_cert_macros.py tests/src/test_certs.h # generate_visualc_files enumerates source files (library/*.c). It doesn't diff --git a/tests/scripts/test_psa_compliance.py b/tests/scripts/test_psa_compliance.py index d4e4979890..7c09afc19c 100755 --- a/tests/scripts/test_psa_compliance.py +++ b/tests/scripts/test_psa_compliance.py @@ -39,7 +39,14 @@ def main(library_build_dir: str): in_tf_psa_crypto_repo = build_tree.looks_like_tf_psa_crypto_root(root_dir) crypto_name = build_tree.crypto_library_filename(root_dir) - library_subdir = build_tree.crypto_core_directory(root_dir, relative=True) + + # Temporary, while the crypto library is still located in the library + # directory. This will not be the case anymore when it will be built by + # the TF-PSA-Crypto build system. + if in_tf_psa_crypto_repo: + library_subdir = build_tree.crypto_core_directory(root_dir, relative=True) + else: + library_subdir = 'library' crypto_lib_filename = (library_build_dir + '/' + library_subdir + '/' +