setup_dir v setup

This commit is contained in:
Thomas Levine 2012-10-10 14:25:44 -04:00
parent 6062a8161f
commit 59b3497af1

13
urchin
View File

@ -6,24 +6,29 @@ recurse() {
then then
( (
cd "$potential_test" cd "$potential_test"
[ -f setup ] && . ./setup [ -f setup_dir ] && . ./setup_dir
for test in * for test in *
do recurse "${test}" do recurse "${test}"
done done
[ -f teardown ] && [ -x teardown ] && ./teardown [ -f teardown_dir ] && [ -x teardown_dir ] && ./teardown_dir
) )
elif [ -x "$potential_test" ] elif [ -x "$potential_test" ]
then then
#stdout_file=$(mktemp) #stdout_file=$(mktemp)
stdout_file=/tmp/urchin_stdout stdout_file=/tmp/urchin_stdout
# Run the test
[ -f setup ] && . ./setup
./"$potential_test" > $stdout_file ./"$potential_test" > $stdout_file
[ -f teardown ] && [ -x teardown ] && ./teardown
if [ "$?" = '0' ] if [ "$?" = '0' ]
then then
# Print a '✓' # On success, print a '✓'
echo -ne '\033[32m✓ \033[0m' echo -ne '\033[32m✓ \033[0m'
echo "${potential_test}" echo "${potential_test}"
else else
# Print a red '✗' # On fail, print a red '✗'
echo -ne '\033[31m✗ \033[0m' echo -ne '\033[31m✗ \033[0m'
echo "${potential_test}" echo "${potential_test}"
cat $stdout_file cat $stdout_file