gux/tests/run.sh

33 lines
542 B
Bash
Executable File

#!/bin/env bash
SUCCESS=0
TOTAL=0
for file in $(find . -name "*.gux" | sort)
do
MSG=$(guxi $file 2>&1)
RET=$?
echo -en "$file -> "
if [ $RET -eq 0 ]
then
echo -e "\e[32mpass\e[0m"
SUCCESS=$(($SUCCESS + 1))
else
echo -e "\e[31mfail\e[0m"
echo -e "\e[33m$MSG\e[0m"
fi
TOTAL=$(($TOTAL + 1))
done
echo
if [ $SUCCESS -eq $TOTAL ]
then
echo -e "\e[32m--- All tests passed ---\e[0m"
else
FAIL=$(($TOTAL - $SUCCESS))
echo -e "\e[31m... $FAIL tests failed ...\e[0m"
fi