From ec541fe0a18da106f48e7a1dcaaa18825c97a6de Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 31 Jan 2020 14:24:14 +0100 Subject: [PATCH] Add test components for crypto-only builds For each of the crypto-only presets, run the build and check that the resulting libmbedx509 and libmbedtls are empty. Don't bother testing, because for each crypto-only preset, another component builds that plus the x509 and tls parts and tests everything. --- tests/scripts/all.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 1ad11ffb5..4c0b89198 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -899,6 +899,33 @@ component_build_deprecated () { make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests } +# Check that the specified libraries exist and are empty. +are_empty_libraries () { + nm "$@" >/dev/null 2>/dev/null + ! nm "$@" 2>/dev/null | grep -v ':$' | grep . +} + +component_build_crypto_default () { + msg "build: make, crypto only" + scripts/config.py crypto + make CFLAGS='-O0' + if_build_succeeded are_empty_libraries library/libmbedx509.* library/libmbedtls.* +} + +component_build_crypto_full () { + msg "build: make, crypto only, full config" + scripts/config.py crypto_full + make CFLAGS='-O0' + if_build_succeeded are_empty_libraries library/libmbedx509.* library/libmbedtls.* +} + +component_build_crypto_baremetal () { + msg "build: make, crypto only, baremetal config" + scripts/config.py crypto_baremetal + make CFLAGS='-O0 -Werror' + if_build_succeeded are_empty_libraries library/libmbedx509.* library/libmbedtls.* +} + component_test_depends_curves () { msg "test/build: curves.pl (gcc)" # ~ 4 min record_status tests/scripts/curves.pl