Files
mgmt/test/test-misc.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

30 lines
724 B
Bash
Executable File

#!/usr/bin/env bash
# simple tests that don't deserve their own testfile
# library of utility functions
# shellcheck disable=SC1091
. test/util.sh
echo running "$0"
ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${ROOT}" || exit 1
failures=''
# ensure there is no trailing whitespace or other whitespace errors
run-test git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
# ensure entries to authors file are sorted
start=$(($(grep -n '^[[:space:]]*$' AUTHORS | awk -F ':' '{print $1}' | head -1) + 1))
run-test diff <(tail -n +$start AUTHORS | sort) <(tail -n +$start AUTHORS)
if [[ -n "$failures" ]]; then
echo 'FAIL'
echo "The following tests have failed:"
echo -e "$failures"
echo
exit 1
fi
echo 'PASS'