mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-06-13 19:21:32 +03:00
Add test class for key generation
Genertae test_suite_psa_crypto_generate_key.generated.data. Use test_suite_psa_crypto_generate_key.function as a test function. Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
@ -42,6 +42,7 @@ class TestCase:
|
||||
self.dependencies = [] #type: List[str]
|
||||
self.function = None #type: Optional[str]
|
||||
self.arguments = [] #type: List[str]
|
||||
self.result = '' #type: str
|
||||
|
||||
def add_comment(self, *lines: str) -> None:
|
||||
self.comments += lines
|
||||
@ -58,6 +59,9 @@ class TestCase:
|
||||
def set_arguments(self, arguments: List[str]) -> None:
|
||||
self.arguments = arguments
|
||||
|
||||
def set_result(self, result: str) -> None:
|
||||
self.result = result
|
||||
|
||||
def check_completeness(self) -> None:
|
||||
if self.description is None:
|
||||
raise MissingDescription
|
||||
@ -81,9 +85,11 @@ class TestCase:
|
||||
out.write(self.description + '\n')
|
||||
if self.dependencies:
|
||||
out.write('depends_on:' + ':'.join(self.dependencies) + '\n')
|
||||
out.write(self.function + ':' + ':'.join(self.arguments) + '\n')
|
||||
|
||||
|
||||
out.write(self.function + ':' + ':'.join(self.arguments))
|
||||
if self.result:
|
||||
out.write(':' + self.result + '\n')
|
||||
else:
|
||||
out.write('\n')
|
||||
|
||||
def write_data_file(filename: str,
|
||||
test_cases: Iterable[TestCase],
|
||||
|
Reference in New Issue
Block a user