44 lines
799 B
Bash
44 lines
799 B
Bash
|
#!/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
|