1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-05-10 08:59:05 +08:00

Adapt to generate_config_tests.py changes

Adapt builds and check-generated-files.sh to the fact
that generate_config_tests.py does not generate
test_suite_config.psa_boolean.data in Mbed TLS 4.x
context anymore.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2025-03-11 12:53:45 +01:00
parent a1e1c2ce3c
commit 81a674eee8
4 changed files with 22 additions and 22 deletions

View File

@ -21,12 +21,12 @@ perl scripts\generate_visualc_files.pl || exit /b 1
@rem @@@@ programs\** @@@@ @rem @@@@ programs\** @@@@
cd tf-psa-crypto cd tf-psa-crypto
python scripts\generate_psa_constants.py || exit /b 1 python scripts\generate_psa_constants.py || exit /b 1
python framework\scripts\generate_config_tests.py || exit /b 1
cd .. cd ..
@rem @@@@ tests\** @@@@ @rem @@@@ tests\** @@@@
python framework\scripts\generate_bignum_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1 python framework\scripts\generate_bignum_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1
python framework\scripts\generate_config_tests.py tests\suites\test_suite_config.mbedtls_boolean.data || exit /b 1 python framework\scripts\generate_config_tests.py || exit /b 1
python framework\scripts\generate_config_tests.py --directory tf-psa-crypto\tests\suites tests\suites\test_suite_config.psa_boolean.data || exit /b 1
python framework\scripts\generate_ecp_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1 python framework\scripts\generate_ecp_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1
python framework\scripts\generate_psa_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1 python framework\scripts\generate_psa_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1
python framework\scripts\generate_test_keys.py --output framework\tests\include\test\test_keys.h || exit /b 1 python framework\scripts\generate_test_keys.py --output framework\tests\include\test\test_keys.h || exit /b 1

View File

@ -19,15 +19,9 @@ execute_process(
WORKING_DIRECTORY WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..
OUTPUT_VARIABLE OUTPUT_VARIABLE
base_config_generated_data_files_raw) base_config_generated_data_files)
string(REGEX REPLACE "[^;]*/" "" string(REGEX REPLACE "[^;]*/" ""
base_config_generated_data_files_raw "${base_config_generated_data_files_raw}") base_config_generated_data_files "${base_config_generated_data_files}")
# Can be replace by list(FILTER ...) when CI CMake version is >=3.6
foreach(file ${base_config_generated_data_files_raw})
if(${file} MATCHES "mbedtls")
list(APPEND base_config_generated_data_files ${file})
endif()
endforeach()
# Derive generated file paths in the build directory. The generated data # Derive generated file paths in the build directory. The generated data
# files go into the suites/ subdirectory. # files go into the suites/ subdirectory.
@ -50,7 +44,6 @@ if(GEN_FILES)
${MBEDTLS_PYTHON_EXECUTABLE} ${MBEDTLS_PYTHON_EXECUTABLE}
${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_config_tests.py ${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_config_tests.py
--directory ${CMAKE_CURRENT_BINARY_DIR}/suites --directory ${CMAKE_CURRENT_BINARY_DIR}/suites
${config_generated_data_files}
DEPENDS DEPENDS
${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_config_tests.py ${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_config_tests.py
# Do not declare the configuration files as dependencies: they # Do not declare the configuration files as dependencies: they

View File

@ -25,15 +25,22 @@ $(error "$(PYTHON) ../framework/scripts/generate_bignum_tests.py --list" failed)
endif endif
GENERATED_CRYPTO_DATA_FILES += $(GENERATED_BIGNUM_DATA_FILES) GENERATED_CRYPTO_DATA_FILES += $(GENERATED_BIGNUM_DATA_FILES)
GENERATED_CONFIG_DATA_FILES_RAW := $(patsubst tests/%,%,$(shell \ GENERATED_MBEDTLS_CONFIG_DATA_FILES := $(patsubst tests/%,%,$(shell \
$(PYTHON) ../framework/scripts/generate_config_tests.py --list || \ $(PYTHON) ../framework/scripts/generate_config_tests.py --list || \
echo FAILED \ echo FAILED \
)) ))
ifeq ($(GENERATED_CONFIG_DATA_FILES),FAILED) ifeq ($(GENERATED_MBEDTLS_CONFIG_DATA_FILES),FAILED)
$(error "$(PYTHON) ../framework/scripts/generate_config_tests.py --list" failed) $(error "$(PYTHON) ../framework/scripts/generate_config_tests.py --list" failed)
endif endif
GENERATED_MBEDTLS_CONFIG_DATA_FILES := $(foreach file,$(GENERATED_CONFIG_DATA_FILES_RAW),$(if $(findstring mbedtls,$(file)),$(file),))
GENERATED_PSA_CONFIG_DATA_FILES := $(foreach file,$(GENERATED_CONFIG_DATA_FILES_RAW),$(if $(findstring psa,$(file)),$(addprefix ../tf-psa-crypto/tests/,$(file)),)) GENERATED_PSA_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)
$(error "$(PYTHON) ../tf-psa-crypto/framework/scripts/generate_config_tests.py --list" failed)
endif
GENERATED_CONFIG_DATA_FILES := $(GENERATED_MBEDTLS_CONFIG_DATA_FILES) $(GENERATED_PSA_CONFIG_DATA_FILES) GENERATED_CONFIG_DATA_FILES := $(GENERATED_MBEDTLS_CONFIG_DATA_FILES) $(GENERATED_PSA_CONFIG_DATA_FILES)
GENERATED_DATA_FILES += $(GENERATED_MBEDTLS_CONFIG_DATA_FILES) GENERATED_DATA_FILES += $(GENERATED_MBEDTLS_CONFIG_DATA_FILES)
GENERATED_CRYPTO_DATA_FILES += $(GENERATED_PSA_CONFIG_DATA_FILES) GENERATED_CRYPTO_DATA_FILES += $(GENERATED_PSA_CONFIG_DATA_FILES)
@ -112,8 +119,8 @@ 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: ../framework/scripts/mbedtls_framework/test_data_generation.py
generated_config_test_data: generated_config_test_data:
echo " Gen $(GENERATED_CONFIG_DATA_FILES)" echo " Gen $(GENERATED_CONFIG_DATA_FILES)"
$(PYTHON) ../framework/scripts/generate_config_tests.py $(GENERATED_MBEDTLS_CONFIG_DATA_FILES) $(PYTHON) ../framework/scripts/generate_config_tests.py
$(PYTHON) ../framework/scripts/generate_config_tests.py --directory ../tf-psa-crypto/tests/suites $(GENERATED_PSA_CONFIG_DATA_FILES) cd ../tf-psa-crypto && $(PYTHON) ./framework/scripts/generate_config_tests.py
.SECONDARY: generated_config_test_data .SECONDARY: generated_config_test_data
$(GENERATED_ECP_DATA_FILES): $(gen_file_dep) generated_ecp_test_data $(GENERATED_ECP_DATA_FILES): $(gen_file_dep) generated_ecp_test_data

View File

@ -141,10 +141,10 @@ check()
if [ -d tf-psa-crypto ]; then if [ -d tf-psa-crypto ]; then
cd tf-psa-crypto cd tf-psa-crypto
check scripts/generate_psa_constants.py ./programs/psa/psa_constant_names_generated.c check scripts/generate_psa_constants.py ./programs/psa/psa_constant_names_generated.c
check ../framework/scripts/generate_bignum_tests.py $(../framework/scripts/generate_bignum_tests.py --list) check framework/scripts/generate_bignum_tests.py $(framework/scripts/generate_bignum_tests.py --list)
check ../framework/scripts/generate_config_tests.py tests/suites/test_suite_config.psa_boolean.data check framework/scripts/generate_config_tests.py $(framework/scripts/generate_config_tests.py --list)
check ../framework/scripts/generate_ecp_tests.py $(../framework/scripts/generate_ecp_tests.py --list) check framework/scripts/generate_ecp_tests.py $(framework/scripts/generate_ecp_tests.py --list)
check ../framework/scripts/generate_psa_tests.py $(../framework/scripts/generate_psa_tests.py --list) check framework/scripts/generate_psa_tests.py $(framework/scripts/generate_psa_tests.py --list)
cd .. cd ..
# Generated files that are present in the repository even in the development # Generated files that are present in the repository even in the development
# branch. (This is intended to be temporary, until the generator scripts are # branch. (This is intended to be temporary, until the generator scripts are