Files
mgmt/test/test-crossbuild.sh
Karpfen 7e8ced534f misc: Use /usr/bin/env for a more generic shebang
Use path based SHELL in Makefiles. It was suggested that this is a
better solution for make for cases when there is no /usr/bin/env.

See: https://github.com/purpleidea/mgmt/pull/694#discussion_r1015596204
2025-03-22 14:53:21 -04:00

35 lines
573 B
Bash
Executable File

#!/usr/bin/env bash
set -e -o pipefail
echo running "$(basename "$0")"
. test/util.sh
# test if we can build for all OSes and ARCHes.
tmpdir="`$mktemp --tmpdir -d tmp.XXX`" # get a dir outside of the main package
if [[ ! "$tmpdir" =~ "/tmp" ]]; then
echo "unexpected tmpdir in: ${tmpdir}"
exit 99
fi
log="$tmpdir/$(basename $0 .sh).log"
set +e
make crossbuild &> "$log"
RET=$?
if [ ! $RET -eq 0 ]; then
echo 'FAIL'
cat "$log"
else
echo 'PASS'
fi
if [ "$tmpdir" = "" ]; then
echo "BUG, tried to delete empty string path"
exit 99
fi
rm -rf "$tmpdir"
exit $RET