ccm/tests/run.sh

40 lines
603 B
Bash
Executable File

#!/bin/sh
TOTAL=0
FAILED=0
for file in $(find . -name "*.ccm" | sort)
do
LOG=$(ccm $file 2>&1)
RET=$?
TOTAL=$(($TOTAL + 1))
if [ $RET -eq 0 ]
then
echo -e "\e[36m$file\t\e[32mok\e[0m"
else
echo -e "\e[36m$file\t\e[31mfailed\e[0m"
echo "$LOG"
FAILED=$(($FAILED + 1))
fi
done
echo
if [ $FAILED -eq 0 ]
then
echo -e "\e[32m--- All tests passed ($TOTAL) ---\e[0m"
else
TEST_WORD="tests"
if [ $FAILED -eq 1 ]
then
TEST_WORD="test"
fi
echo -e "\e[31m--- $FAILED $TEST_WORD failed ---\e[0m"
fi