From 840af0a9ae6b8d7797786c5a6e3d83cec3417a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 11 Dec 2018 10:34:04 +0100 Subject: [PATCH] Add tests to all.sh for CHECK_PARAMS edge cases --- tests/scripts/all.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 19baf5e8a..64cb695c8 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -618,6 +618,30 @@ record_status check_headers_in_cpp msg "build: Unix make, incremental g++" make TEST_CPP=1 + +msg "build+test: MBEDTLS_CHECK_PARAMS without MBEDTLS_PLATFORM_C" +cleanup +scripts/config.pl full # includes CHECK_PARAMS +scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests +scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C +scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT +scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT +scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT +scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY +scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT +scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT +scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED +scripts/config.pl unset MBEDTLS_PLATFORM_C +make CC=gcc CFLAGS='-Werror -O1' all test + +msg "build+test: MBEDTLS_CHECK_PARAMS with alternative MBEDTLS_PARAM_FAILED()" +cleanup +scripts/config.pl full # includes CHECK_PARAMS +scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests +sed -i 's/.*\(#define MBEDTLS_PARAM_FAILED( cond )\).*/\1/' "$CONFIG_H" +make CC=gcc CFLAGS='-Werror -O1' all test + + # Full configuration build, without platform support, file IO and net sockets. # This should catch missing mbedtls_printf definitions, and by disabling file # IO, it should catch missing '#include '