aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>2018-12-11 10:34:04 +0100
committerManuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>2018-12-11 12:28:56 +0100
commit840af0a9ae6b8d7797786c5a6e3d83cec3417a7b (patch)
treea67bcd8a7c3fe2e47e509c4f2e7dc8a9b926e8dc
parent22028a0b8d20beb6fbed81a526ba099d22ed2471 (diff)
downloadmbedtls-840af0a9ae6b8d7797786c5a6e3d83cec3417a7b.zip
mbedtls-840af0a9ae6b8d7797786c5a6e3d83cec3417a7b.tar.gz
mbedtls-840af0a9ae6b8d7797786c5a6e3d83cec3417a7b.tar.bz2
Add tests to all.sh for CHECK_PARAMS edge cases
-rwxr-xr-xtests/scripts/all.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 19baf5e..64cb695 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 <stdio.h>'