From 32768c5d2055825e565f4dc514216aee19deea02 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Tue, 28 Nov 2023 16:24:54 +0000 Subject: [PATCH 1/3] Add component for check_generated_files testing Signed-off-by: Thomas Daubney --- tests/all_sh_components.txt | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/all_sh_components.txt b/tests/all_sh_components.txt index 2689850da..d0560b400 100644 --- a/tests/all_sh_components.txt +++ b/tests/all_sh_components.txt @@ -161,3 +161,42 @@ component_test_psa_drivers () { cd "$TF_PSA_CRYPTO_ROOT_DIR" rm -rf "$OUT_OF_SOURCE_DIR" } + +component_check_generated_files () { + msg "Check: check-generated-files, files generated with cmake" # ~2min + TF_PSA_CRYPTO_ROOT_DIR="$PWD" + mkdir "$OUT_OF_SOURCE_DIR" + cd "$OUT_OF_SOURCE_DIR" + + cmake -DGEN_FILES=On .. + cmake --build . + cd - + tests/scripts/check-generated-files.sh + + msg "Check: check-generated-files -u, files present" # 2s + tests/scripts/check-generated-files.sh -u + # Check that the generated files are considered up to date. + tests/scripts/check-generated-files.sh + + # msg "Check: check-generated-files -u, files absent" # 2s + # #command make neat + cd "$TF_PSA_CRYPTO_ROOT_DIR" + rm -rf "$OUT_OF_SOURCE_DIR" + + mkdir "$OUT_OF_SOURCE_DIR" + cd "$OUT_OF_SOURCE_DIR" + + cmake -DGEN_FILES=Off .. + cmake --build . + cd - + + tests/scripts/check-generated-files.sh -u + # Check that the generated files are considered up to date. + tests/scripts/check-generated-files.sh + + cd "$TF_PSA_CRYPTO_ROOT_DIR" + rm -rf "$OUT_OF_SOURCE_DIR" + + # This component ends with the generated files present in the source tree. + # This is necessary for subsequent components! +} From af68a574cd79e11e439f8a90197e936a46a280f9 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Wed, 29 Nov 2023 15:37:15 +0000 Subject: [PATCH 2/3] Build in source tree Signed-off-by: Thomas Daubney --- tests/all_sh_components.txt | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/tests/all_sh_components.txt b/tests/all_sh_components.txt index d0560b400..391c03d6b 100644 --- a/tests/all_sh_components.txt +++ b/tests/all_sh_components.txt @@ -164,13 +164,8 @@ component_test_psa_drivers () { component_check_generated_files () { msg "Check: check-generated-files, files generated with cmake" # ~2min - TF_PSA_CRYPTO_ROOT_DIR="$PWD" - mkdir "$OUT_OF_SOURCE_DIR" - cd "$OUT_OF_SOURCE_DIR" - - cmake -DGEN_FILES=On .. + cmake -DGEN_FILES=On . cmake --build . - cd - tests/scripts/check-generated-files.sh msg "Check: check-generated-files -u, files present" # 2s @@ -179,24 +174,14 @@ component_check_generated_files () { tests/scripts/check-generated-files.sh # msg "Check: check-generated-files -u, files absent" # 2s - # #command make neat - cd "$TF_PSA_CRYPTO_ROOT_DIR" - rm -rf "$OUT_OF_SOURCE_DIR" - mkdir "$OUT_OF_SOURCE_DIR" - cd "$OUT_OF_SOURCE_DIR" - - cmake -DGEN_FILES=Off .. - cmake --build . - cd - + cmake -DGEN_FILES=Off . + cmake --build . --clean-first tests/scripts/check-generated-files.sh -u # Check that the generated files are considered up to date. tests/scripts/check-generated-files.sh - cd "$TF_PSA_CRYPTO_ROOT_DIR" - rm -rf "$OUT_OF_SOURCE_DIR" - # This component ends with the generated files present in the source tree. # This is necessary for subsequent components! } From 483d83096abd0618e63c5fedde2d330227a6d538 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Thu, 14 Dec 2023 09:40:02 +0000 Subject: [PATCH 3/3] Add check_generated_files.sh to PSA copy script Signed-off-by: Thomas Daubney --- scripts/psa_crypto.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/psa_crypto.py b/scripts/psa_crypto.py index a9e72bf1b..c903ac89a 100755 --- a/scripts/psa_crypto.py +++ b/scripts/psa_crypto.py @@ -153,6 +153,7 @@ def copy_from_tests(mbedtls_root_path, psa_crypto_root_path): "generate_test_code.py|"\ "scripts_path.py|"\ "test_generate_test_code.py|"\ + "check_generated_files.sh|"\ "test_psa_compliance.py", file_), os.listdir(scripts_source_path)) for file_ in scripts_files: