urchin/urchin

34 lines
542 B
Bash
Executable File

#!/bin/sh
recurse() {
potential_test="$1"
if [ -d "$potential_test" ]
then
(
cd "$potential_test"
[ -f setup ] && sh setup
ls test* | xargs recurse
[ -f teardown ] && sh teardown
)
elif [ -f "$potential_test" ]
then
sh "$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
recurse tests
else
echo 'No tests directory' && exit 1
fi