mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-28 08:37:25 +00:00
Modify test_psa_compliance.py for psa-crypto repo
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
795d8b523d
commit
1d09184291
@ -28,6 +28,9 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import scripts_path
|
||||||
|
from mbedtls_dev import build_tree
|
||||||
|
|
||||||
# PSA Compliance tests we expect to fail due to known defects in Mbed TLS (or the test suite)
|
# PSA Compliance tests we expect to fail due to known defects in Mbed TLS (or the test suite)
|
||||||
# The test numbers correspond to the numbers used by the console output of the test suite.
|
# The test numbers correspond to the numbers used by the console output of the test suite.
|
||||||
# Test number 2xx corresponds to the files in the folder
|
# Test number 2xx corresponds to the files in the folder
|
||||||
@ -53,8 +56,11 @@ PSA_ARCH_TESTS_REF = 'fix-pr-5736'
|
|||||||
def main():
|
def main():
|
||||||
mbedtls_dir = os.getcwd()
|
mbedtls_dir = os.getcwd()
|
||||||
|
|
||||||
if not os.path.exists('library/libmbedcrypto.a'):
|
is_psa_crypto = build_tree.looks_like_psa_crypto_root(mbedtls_dir) #type: bool
|
||||||
subprocess.check_call(['make', '-C', 'library', 'libmbedcrypto.a'])
|
|
||||||
|
if not is_psa_crypto:
|
||||||
|
if not os.path.exists('library/libmbedcrypto.a'):
|
||||||
|
subprocess.check_call(['make', '-C', 'library', 'libmbedcrypto.a'])
|
||||||
|
|
||||||
psa_arch_tests_dir = 'psa-arch-tests'
|
psa_arch_tests_dir = 'psa-arch-tests'
|
||||||
os.makedirs(psa_arch_tests_dir, exist_ok=True)
|
os.makedirs(psa_arch_tests_dir, exist_ok=True)
|
||||||
@ -74,6 +80,15 @@ def main():
|
|||||||
os.mkdir(build_dir)
|
os.mkdir(build_dir)
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
|
|
||||||
|
if is_psa_crypto:
|
||||||
|
psa_crypto_lib_filename = \
|
||||||
|
'mbedtls_out_of_source_build/core/libpsacrypto.a'
|
||||||
|
else:
|
||||||
|
psa_crypto_lib_filename = 'library/libmbedcrypto.a'
|
||||||
|
|
||||||
|
extra_includes = (';{}/drivers/builtin/include'.format(mbedtls_dir)
|
||||||
|
if is_psa_crypto else '')
|
||||||
|
|
||||||
#pylint: disable=bad-continuation
|
#pylint: disable=bad-continuation
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
'cmake', '..',
|
'cmake', '..',
|
||||||
@ -81,8 +96,9 @@ def main():
|
|||||||
'-DTARGET=tgt_dev_apis_stdc',
|
'-DTARGET=tgt_dev_apis_stdc',
|
||||||
'-DTOOLCHAIN=HOST_GCC',
|
'-DTOOLCHAIN=HOST_GCC',
|
||||||
'-DSUITE=CRYPTO',
|
'-DSUITE=CRYPTO',
|
||||||
'-DPSA_CRYPTO_LIB_FILENAME={}/library/libmbedcrypto.a'.format(mbedtls_dir),
|
'-DPSA_CRYPTO_LIB_FILENAME={}/{}'.format(mbedtls_dir,
|
||||||
'-DPSA_INCLUDE_PATHS={}/include'.format(mbedtls_dir)
|
psa_crypto_lib_filename),
|
||||||
|
('-DPSA_INCLUDE_PATHS={}/include' + extra_includes).format(mbedtls_dir)
|
||||||
])
|
])
|
||||||
subprocess.check_call(['cmake', '--build', '.'])
|
subprocess.check_call(['cmake', '--build', '.'])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user