Split the rules to generate config tests

Have crypto handle the crypto part and tls handle the tls part.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2025-12-18 16:40:32 +01:00
parent 49d698588b
commit 8a528cfed5
2 changed files with 21 additions and 8 deletions

View File

@@ -30,10 +30,7 @@ GENERATED_MBEDTLS_CONFIG_DATA_FILES := $(patsubst tests/%,%,$(shell \
ifeq ($(GENERATED_MBEDTLS_CONFIG_DATA_FILES),FAILED)
$(error "$(PYTHON) ../framework/scripts/generate_config_tests.py --list" failed)
endif
GENERATED_CONFIG_DATA_FILES := $(GENERATED_MBEDTLS_CONFIG_DATA_FILES) $(GENERATED_PSA_CONFIG_DATA_FILES)
GENERATED_DATA_FILES += $(GENERATED_MBEDTLS_CONFIG_DATA_FILES)
TF_PSA_CRYPTO_TESTS_GENERATED_DATA_FILES += $(GENERATED_PSA_CONFIG_DATA_FILES)
GENERATED_C_FILES = \
include/test/test_keys.h include/test/test_certs.h
@@ -69,15 +66,14 @@ generated_files: $(GENERATED_FILES)
# output, to comment out certain options, or even to remove certain
# lines which do affect the output negatively (it will miss the
# corresponding test cases).
$(GENERATED_CONFIG_DATA_FILES): $(gen_file_dep) generated_config_test_data
$(GENERATED_MBEDTLS_CONFIG_DATA_FILES): $(gen_file_dep) generated_config_test_data
generated_config_test_data: ../framework/scripts/generate_config_tests.py
generated_config_test_data: ../scripts/config.py
generated_config_test_data: ../framework/scripts/mbedtls_framework/test_case.py
generated_config_test_data: ../framework/scripts/mbedtls_framework/test_data_generation.py
generated_config_test_data:
echo " Gen $(GENERATED_CONFIG_DATA_FILES)"
echo " Gen $(GENERATED_MBEDTLS_CONFIG_DATA_FILES)"
$(PYTHON) ../framework/scripts/generate_config_tests.py
cd ../tf-psa-crypto && $(PYTHON) ./framework/scripts/generate_config_tests.py
.SECONDARY: generated_config_test_data
# A test application is built for each suites/test_suite_*.data file.

View File

@@ -30,13 +30,30 @@ generated_bignum_test_data:
$(PYTHON) ../framework/scripts/generate_bignum_tests.py --directory ../tf-psa-crypto/tests/suites
.SECONDARY: generated_bignum_test_data
GENERATED_PSA_CONFIG_DATA_FILES := $(addprefix ../tf-psa-crypto/,$(shell \
GENERATED_CRYPTO_CONFIG_DATA_FILES := $(addprefix ../tf-psa-crypto/,$(shell \
$(PYTHON) ../tf-psa-crypto/framework/scripts/generate_config_tests.py --list || \
echo FAILED \
))
ifeq ($(GENERATED_PSA_CONFIG_DATA_FILES),FAILED)
ifeq ($(GENERATED_CRYPTO_CONFIG_DATA_FILES),FAILED)
$(error "$(PYTHON) ../tf-psa-crypto/framework/scripts/generate_config_tests.py --list" failed)
endif
TF_PSA_CRYPTO_TESTS_GENERATED_DATA_FILES += $(GENERATED_CRYPTO_CONFIG_DATA_FILES)
# We deliberately omit the configuration files (mbedtls_config.h,
# crypto_config.h) from the depenency list because during development
# and on the CI, we often edit those in a way that doesn't change the
# output, to comment out certain options, or even to remove certain
# lines which do affect the output negatively (it will miss the
# corresponding test cases).
$(GENERATED_CRYPTO_CONFIG_DATA_FILES): $(gen_file_dep) generated_crypto_config_test_data
generated_crypto_config_test_data: ../framework/scripts/generate_config_tests.py
generated_crypto_config_test_data: ../scripts/config.py
generated_crypto_config_test_data: ../framework/scripts/mbedtls_framework/test_case.py
generated_crypto_config_test_data: ../framework/scripts/mbedtls_framework/test_data_generation.py
generated_crypto_config_test_data:
echo " Gen $(GENERATED_CRYPTO_CONFIG_DATA_FILES)"
cd ../tf-psa-crypto && $(PYTHON) ./framework/scripts/generate_config_tests.py
.SECONDARY: generated_crypto_config_test_data
GENERATED_ECP_DATA_FILES := $(addprefix ../tf-psa-crypto/,$(shell \
$(PYTHON) ../framework/scripts/generate_ecp_tests.py --list || \