tests: cc-compat.sh: fixed bug when all tested compilers aren’t present

This commit is contained in:
Emma Tebibyte 2023-12-24 17:31:17 -07:00
parent ef1416cd42
commit 68b296e963
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -12,7 +12,7 @@ set -e
if ! ls GNUmakefile >/dev/null 2>&1
then
printf '%s: Run this script in the root of the project.\n' "$0" 1>&2
exit 1
exit 64 # sysexits.h(3) EX_USAGE
fi
make clean
@ -24,6 +24,10 @@ for CC in cc\
'zig cc'
do
export CC
command -v "$(printf '%s\n' "$CC" | cut -d ' ' -f1)" >/dev/null 2>&1 \
|| continue
printf '%s: %s: Testing build.\n' "$0" "$CC"
make CC="$CC" && printf '%s: Build successful.\n' "$0"