mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-11 03:07:23 +00:00
Move branch-dependent defaults to the calling script
Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
@@ -20,18 +20,12 @@ from pathlib import Path
|
|||||||
|
|
||||||
from . import build_tree
|
from . import build_tree
|
||||||
|
|
||||||
# PSA Compliance tests we expect to fail due to known defects in Mbed TLS /
|
|
||||||
# TF-PSA-Crypto (or 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
|
|
||||||
# psa-arch-tests/api-tests/dev_apis/crypto/test_c0xx
|
|
||||||
EXPECTED_FAILURES = [] # type: List[int]
|
|
||||||
|
|
||||||
PSA_ARCH_TESTS_REPO = 'https://github.com/ARM-software/psa-arch-tests.git'
|
PSA_ARCH_TESTS_REPO = 'https://github.com/ARM-software/psa-arch-tests.git'
|
||||||
PSA_ARCH_TESTS_REF = 'v23.06_API1.5_ADAC_EAC'
|
|
||||||
|
|
||||||
#pylint: disable=too-many-branches,too-many-statements,too-many-locals
|
#pylint: disable=too-many-branches,too-many-statements,too-many-locals
|
||||||
def test_compliance(library_build_dir: str, expected_failures: List[int]):
|
def test_compliance(library_build_dir: str,
|
||||||
|
psa_arch_tests_ref: str,
|
||||||
|
expected_failures: List[int]) -> int:
|
||||||
"""Check out and run compliance tests."""
|
"""Check out and run compliance tests."""
|
||||||
root_dir = os.getcwd()
|
root_dir = os.getcwd()
|
||||||
install_dir = Path(library_build_dir + "/install_dir").resolve()
|
install_dir = Path(library_build_dir + "/install_dir").resolve()
|
||||||
@@ -55,7 +49,7 @@ def test_compliance(library_build_dir: str, expected_failures: List[int]):
|
|||||||
|
|
||||||
# Reuse existing local clone
|
# Reuse existing local clone
|
||||||
subprocess.check_call(['git', 'init'])
|
subprocess.check_call(['git', 'init'])
|
||||||
subprocess.check_call(['git', 'fetch', PSA_ARCH_TESTS_REPO, PSA_ARCH_TESTS_REF])
|
subprocess.check_call(['git', 'fetch', PSA_ARCH_TESTS_REPO, psa_arch_tests_ref])
|
||||||
subprocess.check_call(['git', 'checkout', 'FETCH_HEAD'])
|
subprocess.check_call(['git', 'checkout', 'FETCH_HEAD'])
|
||||||
|
|
||||||
build_dir = 'api-tests/build'
|
build_dir = 'api-tests/build'
|
||||||
@@ -134,7 +128,8 @@ def test_compliance(library_build_dir: str, expected_failures: List[int]):
|
|||||||
finally:
|
finally:
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
|
|
||||||
def main() -> None:
|
def main(psa_arch_tests_ref: str,
|
||||||
|
expected_failures: List[int] = []) -> None:
|
||||||
"""Command line entry point."""
|
"""Command line entry point."""
|
||||||
build_dir = 'out_of_source_build'
|
build_dir = 'out_of_source_build'
|
||||||
|
|
||||||
@@ -154,6 +149,8 @@ def main() -> None:
|
|||||||
if args.expected_failures is not None:
|
if args.expected_failures is not None:
|
||||||
expected_failures_list = [int(i) for i in args.expected_failures]
|
expected_failures_list = [int(i) for i in args.expected_failures]
|
||||||
else:
|
else:
|
||||||
expected_failures_list = EXPECTED_FAILURES
|
expected_failures_list = expected_failures
|
||||||
|
|
||||||
sys.exit(test_compliance(build_dir, expected_failures_list))
|
sys.exit(test_compliance(build_dir,
|
||||||
|
psa_arch_tests_ref,
|
||||||
|
expected_failures_list))
|
||||||
|
|||||||
@@ -7,7 +7,18 @@ Transitional wrapper to facilitate the migration of consuming branches.
|
|||||||
# Copyright The Mbed TLS Contributors
|
# Copyright The Mbed TLS Contributors
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
from mbedtls_framework import psa_compliance
|
from mbedtls_framework import psa_compliance
|
||||||
|
|
||||||
|
PSA_ARCH_TESTS_REF = 'v23.06_API1.5_ADAC_EAC'
|
||||||
|
|
||||||
|
# PSA Compliance tests we expect to fail due to known defects in Mbed TLS /
|
||||||
|
# TF-PSA-Crypto (or 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
|
||||||
|
# psa-arch-tests/api-tests/dev_apis/crypto/test_c0xx
|
||||||
|
EXPECTED_FAILURES = [] # type: List[int]
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
psa_compliance.main()
|
psa_compliance.main(PSA_ARCH_TESTS_REF, expected_failures=EXPECTED_FAILURES)
|
||||||
|
|||||||
Reference in New Issue
Block a user