pretty test output, and test stdout written to temporary file

This commit is contained in:
Zarino Zappia 2012-10-09 16:45:20 +01:00
parent 35eb7c4605
commit a70f1f6033
1 changed files with 12 additions and 8 deletions

20
urchin
View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
recurse() {
potential_test="$1"
@ -14,17 +14,21 @@ recurse() {
)
elif [ -x "$potential_test" ]
then
./"$potential_test"
#stdout_file=$(mktemp)
stdout_file=/tmp/urchin_stdout
./"$potential_test" > $stdout_file
if [ "$?" = '0' ]
then
# Print a '.'
echo -n .
# Print a '✓'
echo -ne '\033[32m✓ \033[0m'
echo "${potential_test}"
else
# Print a red 'F'
echo -ne '\033[31mF'
echo -n "(${potential_test})"
echo -ne "\033[0m"
# Print a red ''
echo -ne '\033[31m✗ \033[0m'
echo "${potential_test}"
cat $stdout_file
fi
rm $stdout_file
fi
}