urchin/urchin

41 lines
778 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"
2012-10-08 10:29:15 -04:00
[ -f setup ] && . ./setup
2012-10-08 10:16:49 -04:00
for test in *
2012-10-08 08:50:48 -04:00
do recurse "${test}"
done
2012-10-08 10:16:49 -04:00
[ -f teardown ] && [ -x teardown ] && ./teardown
2012-10-04 07:29:34 -04:00
)
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'
2012-10-08 09:26:44 -04:00
echo -n "(${potential_test})"
2012-10-08 10:34:17 -04:00
echo -ne "\033[0m"
2012-10-04 07:29:34 -04:00
fi
fi
}
2012-10-04 12:43:49 -04:00
2012-10-08 10:43:14 -04:00
if [ "$*" = '' ]
then
echo Running tests
recurse .
echo
echo Done
else
echo 'Run `urchin` without arguments from a directory containing urchin tests.'
echo 'Go to http://www.urchin.sh for documentation on writing tests.'
fi