diff --git a/tests/Makefile b/tests/Makefile index 79f5b8e703..29f2fa142f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -62,7 +62,7 @@ BINARIES := $(addsuffix $(EXEXT),$(APPS)) .SILENT: -.PHONY: all check test clean +.PHONY: all c_files check test clean all: $(BINARIES) @@ -70,6 +70,7 @@ $(DEP): $(MAKE) -C ../library C_FILES := $(addsuffix .c,$(APPS)) +c_files: $(C_FILES) # Wildcard target for test code generation: # A .c file is generated for each .data file in the suites/ directory. Each .c diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 1e56c3e62a..1a4de44b66 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -691,6 +691,18 @@ component_check_doxygen_warnings () { record_status tests/scripts/doxygen.sh } +component_check_python2 () { + # Check that what used to work with Python 2 still works with Python 2. + msg "check: python2 compatibility" + mkdir -p tests/with_python2 tests/with_python3 + make -C tests PYTHON=python2 c_files + mv tests/test_suite_*.c tests/with_python2/ + make -C tests PYTHON=python3 c_files + mv tests/test_suite_*.c tests/with_python3/ + diff -r tests/with_python2 tests/with_python3 + rm -rf tests/with_python2 tests/with_python3 +} + ################################################################ diff --git a/tests/scripts/generate_test_code.py b/tests/scripts/generate_test_code.py index f452b3767a..b74ed5501f 100755 --- a/tests/scripts/generate_test_code.py +++ b/tests/scripts/generate_test_code.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 + +# This script should still be compatible with Python 2 in Mbed TLS 2.16.x. + # Test suites code generator. # # Copyright The Mbed TLS Contributors