Merge pull request #44 from snobu/master

Added test case for ARMhf static binary
This commit is contained in:
Eric Kidd 2018-04-08 12:58:17 -04:00 committed by GitHub
commit 60412c3f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,14 +19,29 @@ set -euo pipefail
export USER=rust export USER=rust
cargo new --vcs none --bin testme cargo new --vcs none --bin testme
cd testme cd testme
# Add test cases here
echo -e '\nRunning tests...\n'
echo -e '--- Test case for x86_64:'
cargo build cargo build
echo 'Checking to make sure it is not a dynamic executable' echo 'ldd says:'
if ldd target/x86_64-unknown-linux-musl/debug/testme; then if ldd target/x86_64-unknown-linux-musl/debug/testme; then
echo 'Executable is not static!' 1>&2 echo '[FAIL] Executable is not static!' 1>&2
echo 'FAIL.' 1>&2
exit 1 exit 1
fi fi
echo -e '[PASS] x86_64 binary is statically linked.\n'
echo -e '--- Test case for ARMhf:'
cargo build --target=armv7-unknown-linux-musleabihf
echo 'ldd says:'
if ldd target/armv7-unknown-linux-musleabihf/debug/testme; then
echo '[FAIL] Executable is not static!' 1>&2
exit 1
fi
echo -e '[PASS] ARMhf binary is statically linked.\n'
" "
# We're good. # We're good.
echo 'OK. Tests passed.' 1>&2 echo 'OK. ALL TESTS PASSED.' 1>&2