scripts/run_tests.sh: show ldd output if binary isn't dynamically linked

This commit is contained in:
Eric Biggers 2020-10-26 20:06:59 -07:00
parent 952329aeb9
commit 6d66819651

View File

@ -210,9 +210,12 @@ test_use_shared_lib() {
fail "Binary should be statically linked by default" fail "Binary should be statically linked by default"
fi fi
$MAKE USE_SHARED_LIB=1 all check > /dev/null $MAKE USE_SHARED_LIB=1 all check > /dev/null
if ! ldd gzip | grep -q 'libdeflate.so'; then ldd gzip > "$TMPDIR/ldd.out"
if ! grep -q 'libdeflate.so' "$TMPDIR/ldd.out"; then
cat 1>&2 "$TMPDIR/ldd.out"
fail "Binary isn't dynamically linked" fail "Binary isn't dynamically linked"
fi fi
rm "$TMPDIR/ldd.out"
} }
install_uninstall_tests() { install_uninstall_tests() {