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

34 lines
769 B
Bash
Executable File

#!/usr/bin/env bash
# check that our modules still build, even if we don't run them here
# shellcheck disable=SC1091
. test/util.sh
echo running "$0"
ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${ROOT}"
failures=''
# Test modules/ directory to see if the .mcl files compile correctly.
find_mcl_modules() {
git ls-files | grep '\.mcl$' | grep '^modules/' | grep -v 'examples/lang/'
}
# TODO: It might be better to only test from the root module entrypoint.
for file in $(find_mcl_modules); do
#echo "mcl: $file"
run-test ./mgmt run --tmp-prefix lang --only-unify "$file" &> /dev/null || fail_test "could not compile: $file"
done
if [[ -n "$failures" ]]; then
echo 'FAIL'
echo "The following tests have failed:"
echo -e "$failures"
echo
exit 1
fi
echo 'PASS'