grino/examples/run.sh

37 lines
569 B
Bash
Raw Permalink Normal View History

2023-09-11 12:27:44 +00:00
#!/usr/bin/env bash
OK=0
TOTAL=0
for file in `find . -name "*.gri" -exec basename {} \;`
do
echo -en "\e[34m$file ... \e[0m"
MSG="$(grino $file 2>&1 > /dev/null)"
RES=$?
if [ "$RES" == "0" ]
then
echo -e "ok"
OK=$(($OK + 1))
else
echo "ko"
echo -e "\t\e[31m$MSG\e[0m"
fi
TOTAL=$(($TOTAL + 1))
done
echo
if [ $OK -eq $TOTAL ]
then
echo -e "\e[32m=== $OK/$TOTAL tests passed ! ===\e[0m"
exit 0
fi
FAILURE=$(($TOTAL - $OK))
echo -e "\e[31m=== $FAILURE/$TOTAL tests failed ===\e[0m"
exit -1