Skip to content

Commit 69feebd

Browse files
More precise name for test data generation
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 <Gilles.Peskine@arm.com>
1 parent 40de3d3 commit 69feebd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

tests/scripts/generate_bignum_tests.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
Class structure:
88
9-
Child classes of test_generation.BaseTarget (file targets) represent an output
9+
Child classes of test_data_generation.BaseTarget (file targets) represent an output
1010
file. These indicate where test cases will be written to, for all subclasses of
1111
this target. Multiple file targets should not reuse a `target_basename`.
1212
@@ -36,7 +36,7 @@
3636
call `.create_test_case()` to yield the TestCase.
3737
3838
Additional details and other attributes/methods are given in the documentation
39-
of BaseTarget in test_generation.py.
39+
of BaseTarget in test_data_generation.py.
4040
"""
4141

4242
# Copyright The Mbed TLS Contributors
@@ -63,7 +63,7 @@
6363

6464
import scripts_path # pylint: disable=unused-import
6565
from mbedtls_dev import test_case
66-
from mbedtls_dev import test_generation
66+
from mbedtls_dev import test_data_generation
6767

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

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

8787

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

236236
if __name__ == '__main__':
237237
# Use the section of the docstring relevant to the CLI as description
238-
test_generation.main(sys.argv[1:], "\n".join(__doc__.splitlines()[:4]))
238+
test_data_generation.main(sys.argv[1:], "\n".join(__doc__.splitlines()[:4]))

tests/scripts/generate_psa_tests.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from mbedtls_dev import macro_collector
3131
from mbedtls_dev import psa_storage
3232
from mbedtls_dev import test_case
33-
from mbedtls_dev import test_generation
33+
from mbedtls_dev import test_data_generation
3434

3535

3636
def psa_want_symbol(name: str) -> str:
@@ -894,7 +894,7 @@ def generate_all_keys(self) -> Iterator[StorageTestData]:
894894
yield from super().generate_all_keys()
895895
yield from self.all_keys_for_implicit_usage()
896896

897-
class PSATestGenerator(test_generation.TestGenerator):
897+
class PSATestGenerator(test_data_generation.TestGenerator):
898898
"""Test generator subclass including PSA targets and info."""
899899
# Note that targets whose names contain 'test_format' have their content
900900
# validated by `abi_check.py`.
@@ -919,4 +919,4 @@ def generate_target(self, name: str, *target_args) -> None:
919919
super().generate_target(name, self.info)
920920

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

0 commit comments

Comments
 (0)