urchin/urchin

40 lines
650 B
Plaintext
Raw Normal View History

2012-10-04 07:24:03 -04:00
#!/bin/sh
2012-10-04 07:29:34 -04:00
recurse() {
potential_test="$1"
if [ -d "$potential_test" ]
then
(
cd "$potential_test"
[ -f setup ] && sh setup
2012-10-08 08:50:48 -04:00
for test in test*
do recurse "${test}"
done
2012-10-04 07:29:34 -04:00
[ -f teardown ] && sh teardown
)
2012-10-08 08:59:14 -04:00
elif [ -x "$potential_test" ]
2012-10-04 07:29:34 -04:00
then
2012-10-08 08:59:14 -04:00
./"$potential_test"
if [ "$?" = '0' ]
2012-10-04 07:29:34 -04:00
then
2012-10-04 07:32:33 -04:00
# Print a '.'
echo -n .
2012-10-04 07:29:34 -04:00
else
2012-10-04 07:32:33 -04:00
# Print a red 'F'
echo -ne '\033[31mF'
echo -ne "\033[0m"
2012-10-08 09:26:44 -04:00
echo -n "(${potential_test})"
2012-10-04 07:29:34 -04:00
fi
fi
}
2012-10-04 12:43:49 -04:00
if [ -d tests ]
then
2012-10-08 08:50:48 -04:00
echo Running tests
2012-10-04 12:43:49 -04:00
recurse tests
2012-10-08 08:50:48 -04:00
echo
echo Done
2012-10-04 12:43:49 -04:00
else
echo 'No tests directory' && exit 1
fi