diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..ea31835 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +.urchin.log diff --git a/tests/counting/seven_successes b/tests/counting/seven_successes index 984848a..450af11 100755 --- a/tests/counting/seven_successes +++ b/tests/counting/seven_successes @@ -1,3 +1,3 @@ #!/bin/sh -../../urchin .fixture | grep '7 tests failed.' +../../urchin .fixture | grep '7 tests passed.' diff --git a/tests/counting/three_failures b/tests/counting/three_failures index dee2853..9db4dfd 100755 --- a/tests/counting/three_failures +++ b/tests/counting/three_failures @@ -1,3 +1,3 @@ #!/bin/sh -../../urchin .fixture | grep '3 tests passed.' +../../urchin .fixture | grep '3 tests failed.' diff --git a/urchin b/urchin index 8dcf589..1dc2ab1 100755 --- a/urchin +++ b/urchin @@ -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 " echo 'Go to http://www.urchin.sh for documentation on writing tests.'