This repository has been archived on 2024-03-07. You can view files and clone it, but cannot push or open issues/pull-requests.
zarn/examples/run.sh

44 lines
799 B
Bash
Raw Normal View History

2023-09-18 17:32:16 +00:00
#!/usr/bin/env bash
TOTAL=0
SUCCESS=0
for file in `find -name "*.zn"`
do
NAME=$(basename $file | cut -d'.' -f1)
MSG=$(zarn "$file" 2>&1 > /dev/null)
STATUS=$?
echo -en "\e[34m$NAME ... \e[0m"
if [ $STATUS -eq 0 ]
then
echo -e "\e[32mok\e[0m"
SUCCESS=$(($SUCCESS + 1))
else
echo -e "\e[31mko\e[0m"
echo "$MSG"
fi
TOTAL=$((TOTAL + 1))
done
FAILURE=$(($TOTAL - $SUCCESS))
if [ $SUCCESS -eq $TOTAL ]
then
echo -e "\e[32m======== All tests passed ========\e[0m"
else
echo -e "\e[31m======== $FAILURE tests failed ========\e[0m"
fi
echo -e "\e[0mok:\t$SUCCESS\e[0m"
echo -e "\e[0mko:\t$FAILURE\e[0m"
if [ $SUCCESS -eq $TOTAL ]
then
echo -e "\e[32mTOTAL:\t$TOTAL\e[0m"
else
echo -e "\e[31mTOTAL:\t$TOTAL\e[0m"
fi