#!/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" echo -n "(${potential_test})" fi fi } if [ -d tests ] then echo Running tests recurse tests echo echo Done else echo 'No tests directory' && exit 1 fi