From 049270ef92d6f5132af640c3c6ec710f2d64ab3f Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Thu, 9 Jan 2025 20:58:16 +0000 Subject: [PATCH] Enable collect_test_cases.py to work for TF-PSA-Crypto This commit adapts collect_test_cases.py to work for Mbed TLS and TF-PSA-Crypto. Signed-off-by: Harry Ramsey --- scripts/mbedtls_framework/collect_test_cases.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/mbedtls_framework/collect_test_cases.py b/scripts/mbedtls_framework/collect_test_cases.py index 2567b57a3..6f0c65c65 100644 --- a/scripts/mbedtls_framework/collect_test_cases.py +++ b/scripts/mbedtls_framework/collect_test_cases.py @@ -126,9 +126,13 @@ option""" @staticmethod def collect_test_directories(): """Get the relative path for the TLS and Crypto test directories.""" - mbedtls_root = build_tree.guess_mbedtls_root() - directories = [os.path.join(mbedtls_root, 'tests'), - os.path.join(mbedtls_root, 'tf-psa-crypto', 'tests')] + project_root = build_tree.guess_project_root() + if build_tree.looks_like_mbedtls_root(project_root) and not build_tree.is_mbedtls_3_6(): + directories = [os.path.join(project_root, 'tests'), + os.path.join(project_root, 'tf-psa-crypto', 'tests')] + else: + directories = [os.path.join(project_root, 'tests')] + directories = [os.path.relpath(p) for p in directories] return directories