From acaabe796eaa7ba09262f78c433f14e42292a532 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Wed, 7 Nov 2018 11:52:52 +0000 Subject: [PATCH] crypto: Test without crypto as a submodule Add a test to ensure that when the crypto submodule is not used, the crypto library is not created and that libmbedcrypto.a does not contain symbols from files contained within the crypto submodule. --- tests/scripts/all.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index c13e127408..27f78ecd9e 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -624,6 +624,29 @@ make CC=gcc USE_CRYPTO_SUBMODULE=1 test msg "test: ssl-opt.sh (USE_CRYPTO_SUBMODULE, make)" if_build_succeeded tests/ssl-opt.sh +# Don't USE_CRYPTO_SUBMODULE: check that the submodule is not used with make +msg "build: make, full config - USE_CRYPTO_SUBMODULE, gcc+debug" +cleanup +cp "$CONFIG_H" "$CONFIG_BAK" +scripts/config.pl full +make CC=gcc CFLAGS='-g' +msg "test: submodule libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, make)" +if_build_succeeded not test -f crypto/library/libmbedcrypto.a +msg "test: libmbedcrypto symbols are from library files (USE_CRYPTO_SUBMODULE, make)" +if_build_succeeded objdump -g library/libmbedcrypto.a | grep -E 'library$' | not grep 'crypto' > /dev/null + +# Don't USE_CRYPTO_SUBMODULE: check that the submodule is not used with CMake +msg "build: cmake, full config - USE_CRYPTO_SUBMODULE, gcc+debug" +cleanup +cp "$CONFIG_H" "$CONFIG_BAK" +scripts/config.pl full +CC=gcc cmake -D CMAKE_BUILD_TYPE=Debug . +make +msg "test: submodule libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, cmake)" +if_build_succeeded not test -f crypto/library/libmbedcrypto.a +msg "test: libmbedcrypto symbols are from library files (USE_CRYPTO_SUBMODULE, cmake)" +if_build_succeeded objdump -g library/libmbedcrypto.a | grep -E 'library$' | not grep 'crypto' > /dev/null + msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s cleanup cp "$CONFIG_H" "$CONFIG_BAK"