mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-13 15:42:26 +02:00
Merge pull request #4461 from gilles-peskine-arm/generate-tests-python3-make-2.16
Generate tests python3 make 2.16
This commit is contained in:
4
ChangeLog.d/make-generate-tests-python.txt
Normal file
4
ChangeLog.d/make-generate-tests-python.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Changes
|
||||
* When building the test suites with GNU make, invoke python3 or python, not
|
||||
python2. The build still works with either Python 2.7 or 3.5+, but we
|
||||
recommend using a version of Python that is supported upstream.
|
||||
@@ -44,8 +44,7 @@ else
|
||||
DLEXT ?= so
|
||||
EXEXT=
|
||||
SHARED_SUFFIX=
|
||||
# python2 for POSIX since FreeBSD has only python2 as default.
|
||||
PYTHON ?= python2
|
||||
PYTHON ?= $(shell if type python3 >/dev/null 2>/dev/null; then echo python3; else echo python; fi)
|
||||
endif
|
||||
|
||||
# Zlib shared library extensions:
|
||||
@@ -63,7 +62,7 @@ BINARIES := $(addsuffix $(EXEXT),$(APPS))
|
||||
|
||||
.SILENT:
|
||||
|
||||
.PHONY: all check test clean
|
||||
.PHONY: all c_files check test clean
|
||||
|
||||
all: $(BINARIES)
|
||||
|
||||
@@ -71,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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
################################################################
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user