gux/tests/run.sh

33 lines
541 B
Bash
Raw Permalink Normal View History

2024-02-10 15:16:00 +00:00
#!/bin/env bash
SUCCESS=0
TOTAL=0
for file in $(find . -name "*.gux" | sort)
do
2024-02-16 21:47:37 +00:00
MSG=$(gux $file 2>&1)
2024-02-10 15:16:00 +00:00
RET=$?
echo -en "$file -> "
2024-02-10 15:16:00 +00:00
if [ $RET -eq 0 ]
then
echo -e "\e[32mpass\e[0m"
SUCCESS=$(($SUCCESS + 1))
else
echo -e "\e[31mfail\e[0m"
echo -e "\e[33m$MSG\e[0m"
fi
TOTAL=$(($TOTAL + 1))
done
echo
if [ $SUCCESS -eq $TOTAL ]
then
echo -e "\e[32m--- All tests passed ---\e[0m"
else
FAIL=$(($TOTAL - $SUCCESS))
echo -e "\e[31m... $FAIL tests failed ...\e[0m"
fi