roza/roza_tests/run.sh

35 lines
569 B
Bash
Raw Normal View History

#!/usr/bin/env bash
OK=0
KO=0
TOTAL=0
for file in $(find . -name "test_*.roza" | sort)
do
roza $file
RET="$?"
NAME=$(basename "$file" | cut -d '.' -f1)
echo -en "\e[34m$NAME...\e[0m"
if [ "$RET" == 0 ]
then
echo -e " \e[32mok\e[0m"
OK=$(($OK + 1))
else
echo -e " \e[31mko\e[0m"
KO=$(($KO + 1))
fi
TOTAL=$(($TOTAL + 1))
done
if [ $OK -eq $TOTAL ]
then
echo -e "\e[32m=== all tests passed ($OK) ===\e[0m"
exit 0
else
echo -e "\e[31m=== some tests failed ($KO) ===\e[0m"
exit -1
fi