urchin/urchin
2012-10-08 08:59:14 -04:00

39 lines
614 B
Bash
Executable File

#!/bin/sh
recurse() {
potential_test="$1"
if [ -d "$potential_test" ]
then
(
cd "$potential_test"
[ -f setup ] && sh setup
for test in test*
do recurse "${test}"
done
[ -f teardown ] && sh teardown
)
elif [ -x "$potential_test" ]
then
./"$potential_test"
if [ "$?" = '0' ]
then
# Print a '.'
echo -n .
else
# Print a red 'F'
echo -ne '\033[31mF'
echo -ne "\033[0m"
fi
fi
}
if [ -d tests ]
then
echo Running tests
recurse tests
echo
echo Done
else
echo 'No tests directory' && exit 1
fi