wuz/tests/errors.sh

37 lines
545 B
Bash
Raw Permalink Normal View History

#!/usr/bin/sh
OK=0
KO=0
COUNTER=0
LINE=1
echo -e "\e[34m=== Error Testing ===\e[0m"
for file in $(find . -name "err_*.wuz")
do
LINE=1
while read line;
do
2023-08-23 20:16:53 +00:00
echo "$line" | wuz &> /dev/null
RET="$?"
2023-08-23 20:16:53 +00:00
if [ "$RET" != "0" ] || [ "$line" == "" ]
then
OK=$(($OK+1))
else
KO=$(($KO+1))
echo -e "\e[33m\tE($file:$LINE) assertion failed\e[0m"
fi
COUNTER=$(($COUNTER + 1))
LINE=$(($LINE + 1))
done < $file
if [ "$KO" == "0" ]
then
echo -e "$file ... \e[32mok\e[0m"
else
echo -e "$file ... \e[31mko\e[0m"
fi
done