all.sh minor fixes

objdump grepping changed
Clarified name of the "without submodule" tests
Removed unnecessary directory changes
This commit is contained in:
Andrzej Kurek 2019-02-13 04:28:26 -05:00
parent 08b807a161
commit ccbff2a522

View File

@ -222,9 +222,7 @@ cleanup()
fi fi
command make clean command make clean
cd crypto command make -C crypto clean
command make clean
cd ..
# Remove CMake artefacts # Remove CMake artefacts
find . -name .git -prune -o \ find . -name .git -prune -o \
@ -236,11 +234,11 @@ cleanup()
rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile
git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile
cd crypto
rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile # Crypto submodule cleaning
git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile rm -f crypto/include/Makefile crypto/include/mbedtls/Makefile crypto/programs/*/Makefile
git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile git -C crypto update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
cd .. git -C crypto checkout -- Makefile library/Makefile programs/Makefile tests/Makefile
if [ -f "$CONFIG_BAK" ]; then if [ -f "$CONFIG_BAK" ]; then
mv "$CONFIG_BAK" "$CONFIG_H" mv "$CONFIG_BAK" "$CONFIG_H"
@ -302,6 +300,10 @@ check_tools()
done done
} }
objdump_must_contain () {
objdump -g "$1" | grep -E "$2"
}
check_headers_in_cpp () { check_headers_in_cpp () {
ls include/mbedtls >headers.txt ls include/mbedtls >headers.txt
<programs/test/cpp_dummy_build.cpp sed -n 's/"$//; s!^#include "mbedtls/!!p' | <programs/test/cpp_dummy_build.cpp sed -n 's/"$//; s!^#include "mbedtls/!!p' |
@ -791,9 +793,9 @@ component_test_submodule_cmake () {
msg "test: top-level libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, cmake)" msg "test: top-level libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, cmake)"
if_build_succeeded not test -f library/libmbedcrypto.a if_build_succeeded not test -f library/libmbedcrypto.a
msg "test: libmbedcrypto symbols are from crypto files (USE_CRYPTO_SUBMODULE, cmake)" msg "test: libmbedcrypto symbols are from crypto files (USE_CRYPTO_SUBMODULE, cmake)"
if_build_succeeded objdump -g crypto/library/libmbedcrypto.a | grep -E 'crypto/library$' > /dev/null if_build_succeeded objdump_must_contain crypto/library/libmbedcrypto.a 'crypto/library$'
msg "test: libmbedcrypto uses top-level config (USE_CRYPTO_SUBMODULE, cmake)" msg "test: libmbedcrypto uses top-level config (USE_CRYPTO_SUBMODULE, cmake)"
if_build_succeeded objdump -g crypto/library/libmbedcrypto.a | grep 'md4.c' > /dev/null if_build_succeeded objdump_must_contain crypto/library/libmbedcrypto.a '^md4\.c'
msg "test: main suites (USE_CRYPTO_SUBMODULE, cmake)" msg "test: main suites (USE_CRYPTO_SUBMODULE, cmake)"
make test make test
msg "test: ssl-opt.sh (USE_CRYPTO_SUBMODULE, cmake)" msg "test: ssl-opt.sh (USE_CRYPTO_SUBMODULE, cmake)"
@ -809,9 +811,9 @@ component_test_submodule_make () {
msg "test: top-level libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, make)" msg "test: top-level libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, make)"
if_build_succeeded not test -f library/libmbedcrypto.a if_build_succeeded not test -f library/libmbedcrypto.a
msg "test: libmbedcrypto symbols are from crypto files (USE_CRYPTO_SUBMODULE, make)" msg "test: libmbedcrypto symbols are from crypto files (USE_CRYPTO_SUBMODULE, make)"
if_build_succeeded objdump -g crypto/library/libmbedcrypto.a | grep -E 'crypto/library$' > /dev/null if_build_succeeded objdump_must_contain crypto/library/libmbedcrypto.a 'crypto/library$'
msg "test: libmbedcrypto uses top-level config (USE_CRYPTO_SUBMODULE, make)" msg "test: libmbedcrypto uses top-level config (USE_CRYPTO_SUBMODULE, make)"
if_build_succeeded objdump -g crypto/library/libmbedcrypto.a | grep 'md4.c' > /dev/null if_build_succeeded objdump_must_contain crypto/library/libmbedcrypto.a '^md4\.c'
msg "test: main suites (USE_CRYPTO_SUBMODULE, make)" msg "test: main suites (USE_CRYPTO_SUBMODULE, make)"
make CC=gcc USE_CRYPTO_SUBMODULE=1 test make CC=gcc USE_CRYPTO_SUBMODULE=1 test
msg "test: ssl-opt.sh (USE_CRYPTO_SUBMODULE, make)" msg "test: ssl-opt.sh (USE_CRYPTO_SUBMODULE, make)"
@ -820,25 +822,25 @@ component_test_submodule_make () {
component_test_not_submodule_make () { component_test_not_submodule_make () {
# Don't USE_CRYPTO_SUBMODULE: check that the submodule is not used with make # Don't USE_CRYPTO_SUBMODULE: check that the submodule is not used with make
msg "build: make, full config - USE_CRYPTO_SUBMODULE, gcc+debug" msg "build: make, full config without USE_CRYPTO_SUBMODULE, gcc+debug"
scripts/config.pl full scripts/config.pl full
make CC=gcc CFLAGS='-g' make CC=gcc CFLAGS='-g'
msg "test: submodule libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, make)" msg "test: submodule libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, make)"
if_build_succeeded not test -f crypto/library/libmbedcrypto.a if_build_succeeded not test -f crypto/library/libmbedcrypto.a
msg "test: libmbedcrypto symbols are from library files (USE_CRYPTO_SUBMODULE, make)" 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 if_build_succeeded objdump -g library/libmbedcrypto.a | if_build_succeeded grep -E 'library$' | if_build_succeeded not grep 'crypto' > /dev/null
} }
component_test_not_submodule_cmake () { component_test_not_submodule_cmake () {
# Don't USE_CRYPTO_SUBMODULE: check that the submodule is not used with CMake # Don't USE_CRYPTO_SUBMODULE: check that the submodule is not used with CMake
msg "build: cmake, full config - USE_CRYPTO_SUBMODULE, gcc+debug" msg "build: cmake, full config without USE_CRYPTO_SUBMODULE, gcc+debug"
scripts/config.pl full scripts/config.pl full
CC=gcc cmake -D CMAKE_BUILD_TYPE=Debug . CC=gcc cmake -D CMAKE_BUILD_TYPE=Debug .
make make
msg "test: submodule libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, cmake)" msg "test: submodule libmbedcrypto wasn't built (USE_CRYPTO_SUBMODULE, cmake)"
if_build_succeeded not test -f crypto/library/libmbedcrypto.a if_build_succeeded not test -f crypto/library/libmbedcrypto.a
msg "test: libmbedcrypto symbols are from library files (USE_CRYPTO_SUBMODULE, cmake)" 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 if_build_succeeded objdump -g library/libmbedcrypto.a | if_build_succeeded grep -E 'library$' | if_build_succeeded not grep 'crypto' > /dev/null
} }
component_test_use_psa_crypto_full_cmake_asan() { component_test_use_psa_crypto_full_cmake_asan() {