From 4d3e710d05e19ce104d7abd53dd438724192b207 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Thu, 14 Feb 2019 04:07:51 -0500 Subject: [PATCH] all.sh - add an "objdump must not have" option to objdump_must_contain --- tests/scripts/all.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 2b7f2cd82..98d71fdde 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -300,8 +300,10 @@ check_tools() done } +# objdump_must_contain OBJECT_FILE MANDATORY_RE [MATCHING_LINES_MUST_NOT_INCLUDE] objdump_must_contain () { - objdump -g "$1" | grep -E "$2" + objdump -g "$1" | grep -E "$2" | + if [ -n "$3" ]; then ! grep -q -E "$3"; else cat; fi } check_headers_in_cpp () { @@ -828,7 +830,7 @@ component_test_not_submodule_make () { 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 | if_build_succeeded grep -E 'library$' | if_build_succeeded not grep 'crypto' > /dev/null + if_build_succeeded objdump_must_contain library/libmbedcrypto.a 'library$' 'crypto' } component_test_not_submodule_cmake () { @@ -840,7 +842,7 @@ component_test_not_submodule_cmake () { 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 | if_build_succeeded grep -E 'library$' | if_build_succeeded not grep 'crypto' > /dev/null + if_build_succeeded objdump_must_contain library/libmbedcrypto.a 'library$' 'crypto' } component_test_use_psa_crypto_full_cmake_asan() {