mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-21 19:20:56 +00:00
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>
This commit is contained in:
parent
1716f06ee3
commit
64f2efdc40
@ -63,7 +63,7 @@ if(GEN_FILES)
|
|||||||
DEPENDS
|
DEPENDS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_bignum_tests.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_bignum_tests.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_case.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_case.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_generation.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_data_generation.py
|
||||||
)
|
)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
OUTPUT
|
||||||
@ -80,7 +80,7 @@ if(GEN_FILES)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/macro_collector.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/macro_collector.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/psa_storage.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/psa_storage.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_case.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_case.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_generation.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_data_generation.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_config.h
|
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_config.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_values.h
|
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_values.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_extra.h
|
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_extra.h
|
||||||
|
@ -93,7 +93,7 @@ generated_files: $(GENERATED_FILES)
|
|||||||
$(GENERATED_BIGNUM_DATA_FILES): generated_bignum_test_data
|
$(GENERATED_BIGNUM_DATA_FILES): generated_bignum_test_data
|
||||||
generated_bignum_test_data: scripts/generate_bignum_tests.py
|
generated_bignum_test_data: scripts/generate_bignum_tests.py
|
||||||
generated_bignum_test_data: ../scripts/mbedtls_dev/test_case.py
|
generated_bignum_test_data: ../scripts/mbedtls_dev/test_case.py
|
||||||
generated_bignum_test_data: ../scripts/mbedtls_dev/test_generation.py
|
generated_bignum_test_data: ../scripts/mbedtls_dev/test_data_generation.py
|
||||||
generated_bignum_test_data:
|
generated_bignum_test_data:
|
||||||
echo " Gen $(GENERATED_BIGNUM_DATA_FILES)"
|
echo " Gen $(GENERATED_BIGNUM_DATA_FILES)"
|
||||||
$(PYTHON) scripts/generate_bignum_tests.py
|
$(PYTHON) scripts/generate_bignum_tests.py
|
||||||
@ -104,7 +104,7 @@ generated_psa_test_data: ../scripts/mbedtls_dev/crypto_knowledge.py
|
|||||||
generated_psa_test_data: ../scripts/mbedtls_dev/macro_collector.py
|
generated_psa_test_data: ../scripts/mbedtls_dev/macro_collector.py
|
||||||
generated_psa_test_data: ../scripts/mbedtls_dev/psa_storage.py
|
generated_psa_test_data: ../scripts/mbedtls_dev/psa_storage.py
|
||||||
generated_psa_test_data: ../scripts/mbedtls_dev/test_case.py
|
generated_psa_test_data: ../scripts/mbedtls_dev/test_case.py
|
||||||
generated_psa_test_data: ../scripts/mbedtls_dev/test_generation.py
|
generated_psa_test_data: ../scripts/mbedtls_dev/test_data_generation.py
|
||||||
## The generated file only depends on the options that are present in
|
## The generated file only depends on the options that are present in
|
||||||
## crypto_config.h, not on which options are set. To avoid regenerating this
|
## crypto_config.h, not on which options are set. To avoid regenerating this
|
||||||
## file all the time when switching between configurations, don't declare
|
## file all the time when switching between configurations, don't declare
|
||||||
|
@ -6,7 +6,7 @@ generate only the specified files.
|
|||||||
|
|
||||||
Class structure:
|
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
|
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`.
|
this target. Multiple file targets should not reuse a `target_basename`.
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ following:
|
|||||||
call `.create_test_case()` to yield the TestCase.
|
call `.create_test_case()` to yield the TestCase.
|
||||||
|
|
||||||
Additional details and other attributes/methods are given in the documentation
|
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
|
# Copyright The Mbed TLS Contributors
|
||||||
@ -63,7 +63,7 @@ from typing import Iterator, List, Tuple, TypeVar
|
|||||||
|
|
||||||
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
|
||||||
from mbedtls_dev import test_generation
|
from mbedtls_dev import test_data_generation
|
||||||
|
|
||||||
T = TypeVar('T') #pylint: disable=invalid-name
|
T = TypeVar('T') #pylint: disable=invalid-name
|
||||||
|
|
||||||
@ -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
|
#pylint: disable=abstract-method
|
||||||
"""Target for bignum (mpi) test case generation."""
|
"""Target for bignum (mpi) test case generation."""
|
||||||
target_basename = 'test_suite_mpi.generated'
|
target_basename = 'test_suite_mpi.generated'
|
||||||
@ -235,4 +235,4 @@ class BignumAdd(BignumOperation):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Use the section of the docstring relevant to the CLI as description
|
# 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]))
|
||||||
|
@ -30,7 +30,7 @@ from mbedtls_dev import crypto_knowledge
|
|||||||
from mbedtls_dev import macro_collector
|
from mbedtls_dev import macro_collector
|
||||||
from mbedtls_dev import psa_storage
|
from mbedtls_dev import psa_storage
|
||||||
from mbedtls_dev import test_case
|
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:
|
def psa_want_symbol(name: str) -> str:
|
||||||
@ -892,7 +892,7 @@ class StorageFormatV0(StorageFormat):
|
|||||||
yield from super().generate_all_keys()
|
yield from super().generate_all_keys()
|
||||||
yield from self.all_keys_for_implicit_usage()
|
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."""
|
"""Test generator subclass including PSA targets and info."""
|
||||||
# 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`.
|
||||||
@ -917,4 +917,4 @@ class PSATestGenerator(test_generation.TestGenerator):
|
|||||||
super().generate_target(name, self.info)
|
super().generate_target(name, self.info)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
test_generation.main(sys.argv[1:], __doc__, PSATestGenerator)
|
test_data_generation.main(sys.argv[1:], __doc__, PSATestGenerator)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user