1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Rework TestGenerator to add file targets

BaseTarget-derived targets are now added to TestGenerator.targets in
initialization. This reduces repeated code in generate_xxx_tests.py
scripts which use this framework.

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
Werner Lewis
2022-09-02 11:56:34 +01:00
parent 6cc5e5f0d9
commit 0d07e86a44
3 changed files with 19 additions and 19 deletions

View File

@ -231,12 +231,5 @@ class BignumAdd(BignumOperation):
return quote_str(hex(self.int_l + self.int_r).replace("0x", "", 1))
class BignumTestGenerator(test_generation.TestGenerator):
"""Test generator subclass, for bignum file Targets."""
TARGETS = {
subclass.target_basename: subclass.generate_tests for subclass in
test_generation.BaseTarget.__subclasses__()
} # type: Dict[str, Callable[[], Iterable[test_case.TestCase]]]
if __name__ == '__main__':
test_generation.main(sys.argv[1:], BignumTestGenerator)
test_generation.main(sys.argv[1:])

View File

@ -898,7 +898,7 @@ class PSATestGenerator(test_generation.TestGenerator):
"""Test generator subclass including PSA targets and info."""
# Note that targets whose names contain 'test_format' have their content
# validated by `abi_check.py`.
TARGETS = {
targets = {
'test_suite_psa_crypto_generate_key.generated':
lambda info: KeyGenerate(info).test_cases_for_key_generation(),
'test_suite_psa_crypto_not_supported.generated':