setup_dir v setup

This commit is contained in:
Thomas Levine 2012-10-10 14:25:44 -04:00
parent 6062a8161f
commit 59b3497af1
1 changed files with 9 additions and 4 deletions

13
urchin
View File

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