From 864e998decba799fd8e63111f553efd869f2a00a Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 11 Oct 2018 11:15:14 +0100 Subject: [PATCH] Add test for MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO to all.sh This commit adds a test to tests/scripts/all.sh exercising an ASan build of the default configuration with MBEDTLS_PLATFORM_MEMORY enabled, MBEDTLS_PLATFORM_CALLOC_MACRO set to std calloc MBEDTLS_PLATFORM_FREE_MACRO set to std free (This should functionally be indistinguishable from a default build) --- tests/scripts/all.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 53c5e37a2..4e44a82af 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -591,6 +591,18 @@ scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc. scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux make CC=gcc CFLAGS='-Werror -O0 -std=c99 -pedantic' lib +msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)" +cleanup +cp "$CONFIG_H" "$CONFIG_BAK" +scripts/config.pl set MBEDTLS_PLATFORM_MEMORY +scripts/config.pl set MBEDTLS_PLATFORM_CALLOC_MACRO calloc +scripts/config.pl set MBEDTLS_PLATFORM_FREE_MACRO free +CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . +make + +msg "test: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)" +make test + if uname -a | grep -F Linux >/dev/null; then msg "build/test: make shared" # ~ 40s cleanup