From 87bf1b5cf40970a87667412a8c8fbfd9574c5c9f Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 3 Jul 2019 20:42:16 +0200 Subject: [PATCH 1/3] Add a test of MBEDTLS_CONFIG_FILE configs/README.txt documents that you can use an alternative configuration file by defining the preprocessor symbol MBEDTLS_CONFIG_FILE. Test this. --- tests/scripts/all.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 0a7439790..b276e47ac 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -970,6 +970,17 @@ component_test_make_shared () { make SHARED=1 all check } +component_build_mbedtls_config_file () { + msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s + # Use the full config so as to catch a maximum of places where + # the check of MBEDTLS_CONFIG_FILE might be missing. + scripts/config.pl full + sed 's!"check_config.h"!"mbedtls/check_config.h"!' <"$CONFIG_H" >full_config.h + echo '#error "MBEDTLS_CONFIG_FILE is not working"' >"$CONFIG_H" + make CFLAGS="-I '$PWD' -DMBEDTLS_CONFIG_FILE='\"full_config.h\"'" + rm -f full_config.h +} + component_test_m32_o0 () { # Build once with -O0, to compile out the i386 specific inline assembly msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s From 2c47ffc37f42e99526580fe020408b9681286d18 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 3 Jul 2019 20:43:05 +0200 Subject: [PATCH 2/3] Test that the shared library build with CMake works --- tests/scripts/all.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index b276e47ac..70c4e4688 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -970,6 +970,13 @@ component_test_make_shared () { make SHARED=1 all check } +component_test_cmake_shared () { + msg "build/test: cmake shared" # ~ 2min + cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On . + make + make test +} + component_build_mbedtls_config_file () { msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s # Use the full config so as to catch a maximum of places where From dc25c32663b47a089700e5828746764018caa56c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 3 Jul 2019 20:43:32 +0200 Subject: [PATCH 3/3] Test that a shared library build produces a dynamically linked executable --- tests/scripts/all.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 70c4e4688..632300b9d 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -968,12 +968,14 @@ component_test_aes_fewer_tables_and_rom_tables () { component_test_make_shared () { msg "build/test: make shared" # ~ 40s make SHARED=1 all check + ldd programs/util/strerror | grep libmbedcrypto } component_test_cmake_shared () { msg "build/test: cmake shared" # ~ 2min cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On . make + ldd programs/util/strerror | grep libmbedcrypto make test }