Skip to content

Commit

Permalink
More precise name for test data generation
Browse files Browse the repository at this point in the history
We have Python code both for test code generation
(tests/scripts/generate_test_code.py) and now for test data generation.
Avoid the ambiguous expression "test generation".

This commit renames the Python module and adjusts all references to it. A
subsequent commit will adjust the documentation.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Oct 14, 2022
1 parent 40de3d3 commit 69feebd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/scripts/generate_bignum_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Class structure:
Child classes of test_generation.BaseTarget (file targets) represent an output
Child classes of test_data_generation.BaseTarget (file targets) represent an output
file. These indicate where test cases will be written to, for all subclasses of
this target. Multiple file targets should not reuse a `target_basename`.
Expand Down Expand Up @@ -36,7 +36,7 @@
call `.create_test_case()` to yield the TestCase.
Additional details and other attributes/methods are given in the documentation
of BaseTarget in test_generation.py.
of BaseTarget in test_data_generation.py.
"""

# Copyright The Mbed TLS Contributors
Expand All @@ -63,7 +63,7 @@

import scripts_path # pylint: disable=unused-import
from mbedtls_dev import test_case
from mbedtls_dev import test_generation
from mbedtls_dev import test_data_generation

T = TypeVar('T') #pylint: disable=invalid-name

Expand All @@ -85,7 +85,7 @@ def combination_pairs(values: List[T]) -> List[Tuple[T, T]]:
)


class BignumTarget(test_generation.BaseTarget, metaclass=ABCMeta):
class BignumTarget(test_data_generation.BaseTarget, metaclass=ABCMeta):
#pylint: disable=abstract-method
"""Target for bignum (mpi) test case generation."""
target_basename = 'test_suite_mpi.generated'
Expand Down Expand Up @@ -235,4 +235,4 @@ def result(self) -> str:

if __name__ == '__main__':
# Use the section of the docstring relevant to the CLI as description
test_generation.main(sys.argv[1:], "\n".join(__doc__.splitlines()[:4]))
test_data_generation.main(sys.argv[1:], "\n".join(__doc__.splitlines()[:4]))
6 changes: 3 additions & 3 deletions tests/scripts/generate_psa_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from mbedtls_dev import macro_collector
from mbedtls_dev import psa_storage
from mbedtls_dev import test_case
from mbedtls_dev import test_generation
from mbedtls_dev import test_data_generation


def psa_want_symbol(name: str) -> str:
Expand Down Expand Up @@ -894,7 +894,7 @@ def generate_all_keys(self) -> Iterator[StorageTestData]:
yield from super().generate_all_keys()
yield from self.all_keys_for_implicit_usage()

class PSATestGenerator(test_generation.TestGenerator):
class PSATestGenerator(test_data_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`.
Expand All @@ -919,4 +919,4 @@ def generate_target(self, name: str, *target_args) -> None:
super().generate_target(name, self.info)

if __name__ == '__main__':
test_generation.main(sys.argv[1:], __doc__, PSATestGenerator)
test_data_generation.main(sys.argv[1:], __doc__, PSATestGenerator)

0 comments on commit 69feebd

Please sign in to comment.