This commit is contained in:
Thomas Levine 2012-10-11 01:10:43 -04:00
parent 43055117df
commit 99ae54e992
4 changed files with 11 additions and 2 deletions

1
tests/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.urchin.log

View File

@ -1,3 +1,3 @@
#!/bin/sh
../../urchin .fixture | grep '7 tests failed.'
../../urchin .fixture | grep '7 tests passed.'

View File

@ -1,3 +1,3 @@
#!/bin/sh
../../urchin .fixture | grep '3 tests passed.'
../../urchin .fixture | grep '3 tests failed.'

8
urchin
View File

@ -52,10 +52,12 @@ recurse() {
# On success, print a '✓'
echo -ne '\033[32m✓ \033[0m'
echo "${potential_test}"
echo "${potential_test} passed" >> "$logfile"
else
# On fail, print a red '✗'
echo -ne '\033[31m✗ \033[0m'
echo "${potential_test}"
echo "${potential_test} failed" >> "$logfile"
cat $stdout_file
fi
rm $stdout_file
@ -65,9 +67,15 @@ recurse() {
if [ "$#" = '1' ] && [ -d "$1" ]
then
echo Running tests
logfile=$(readlink -f "$1/.urchin.log")
echo > "$logfile"
recurse "$1" 0
echo
echo Done
echo $(grep -e 'passed$' "$logfile"|wc -l) tests passed.
echo $(grep -e 'failed$' "$logfile"|wc -l) tests failed.
else
echo "usage: $0 <test directory>"
echo 'Go to http://www.urchin.sh for documentation on writing tests.'