Skip to content

Commit

Permalink
Adapt default path of psa_test_wrappers.[hc]
Browse files Browse the repository at this point in the history
Adapt default path of psa_test_wrappers.[hc]
in generate_psa_wrappers.py when called in
the context of Mbed TLS 4.x.

Signed-off-by: Ronald Cron <[email protected]>
  • Loading branch information
ronald-cron-arm committed Dec 10, 2024
1 parent 0a9a8a7 commit 13c9bdb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/generate_psa_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@

import argparse
from mbedtls_framework.code_wrapper.psa_test_wrapper import PSATestWrapper, PSALoggingTestWrapper

DEFAULT_C_OUTPUT_FILE_NAME = 'tests/src/psa_test_wrappers.c'
DEFAULT_H_OUTPUT_FILE_NAME = 'tests/include/test/psa_test_wrappers.h'
from mbedtls_framework import build_tree

def main() -> None:
DEFAULT_C_OUTPUT_FILE_NAME = 'tests/src/psa_test_wrappers.c'
DEFAULT_H_OUTPUT_FILE_NAME = 'tests/include/test/psa_test_wrappers.h'

project_root = build_tree.guess_project_root()
if build_tree.looks_like_mbedtls_root(project_root) and \
not build_tree.is_mbedtls_3_6():
DEFAULT_C_OUTPUT_FILE_NAME = 'tf-psa-crypto/' + DEFAULT_C_OUTPUT_FILE_NAME
DEFAULT_H_OUTPUT_FILE_NAME = 'tf-psa-crypto/' + DEFAULT_H_OUTPUT_FILE_NAME

parser = argparse.ArgumentParser(description=globals()['__doc__'])
parser.add_argument('--log',
help='Stream to log to (default: no logging code)')
Expand All @@ -26,6 +33,7 @@ def main() -> None:
help=('Output .h file path (default: {}; skip .h output if empty)'
.format(DEFAULT_H_OUTPUT_FILE_NAME)))
options = parser.parse_args()

if options.log:
generator = PSALoggingTestWrapper(DEFAULT_H_OUTPUT_FILE_NAME,
DEFAULT_C_OUTPUT_FILE_NAME,
Expand Down

0 comments on commit 13c9bdb

Please sign in to comment.