Fix TARGET types and code style
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
parent
6d654c6491
commit
e3ad22ecf2
2 changed files with 7 additions and 8 deletions
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""Common test generation classes and main function.
|
"""Common test generation classes and main function.
|
||||||
|
|
||||||
These are used both by generate_psa_tests.py and generate_bignum_tests.py.
|
These are used both by generate_psa_tests.py and generate_bignum_tests.py.
|
||||||
|
@ -150,7 +149,7 @@ class TestGenerator:
|
||||||
|
|
||||||
# Note that targets whose names contain 'test_format' have their content
|
# Note that targets whose names contain 'test_format' have their content
|
||||||
# validated by `abi_check.py`.
|
# validated by `abi_check.py`.
|
||||||
TARGETS = {} # type: Dict[str, Callable[..., test_case.TestCase]]
|
TARGETS = {} # type: Dict[str, Callable[..., Iterable[test_case.TestCase]]]
|
||||||
|
|
||||||
def generate_target(self, name: str, *target_args) -> None:
|
def generate_target(self, name: str, *target_args) -> None:
|
||||||
"""Generate cases and write to data file for a target.
|
"""Generate cases and write to data file for a target.
|
||||||
|
|
|
@ -49,7 +49,7 @@ import itertools
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
from typing import Callable, Dict, Iterator, List, Tuple, TypeVar, cast
|
from typing import Callable, Dict, Iterable, Iterator, List, Tuple, TypeVar, cast
|
||||||
|
|
||||||
import scripts_path # pylint: disable=unused-import
|
import scripts_path # pylint: disable=unused-import
|
||||||
from mbedtls_dev import test_case
|
from mbedtls_dev import test_case
|
||||||
|
@ -206,10 +206,10 @@ class BignumAdd(BignumOperation):
|
||||||
input_cases = cast(
|
input_cases = cast(
|
||||||
List[Tuple[str, str]],
|
List[Tuple[str, str]],
|
||||||
list(itertools.combinations(
|
list(itertools.combinations(
|
||||||
[
|
[
|
||||||
"1c67967269c6", "9cde3",
|
"1c67967269c6", "9cde3",
|
||||||
"-1c67967269c6", "-9cde3",
|
"-1c67967269c6", "-9cde3",
|
||||||
], 2
|
], 2
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ class BignumTestGenerator(test_generation.TestGenerator):
|
||||||
TARGETS = {
|
TARGETS = {
|
||||||
subclass.target_basename: subclass.generate_tests for subclass in
|
subclass.target_basename: subclass.generate_tests for subclass in
|
||||||
test_generation.BaseTarget.__subclasses__()
|
test_generation.BaseTarget.__subclasses__()
|
||||||
} # type: Dict[str, Callable[[], test_case.TestCase]]
|
} # type: Dict[str, Callable[[], Iterable[test_case.TestCase]]]
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
test_generation.main(sys.argv[1:], BignumTestGenerator)
|
test_generation.main(sys.argv[1:], BignumTestGenerator)
|
||||||
|
|
Loading…
Reference in a new issue