counting
This commit is contained in:
parent
43055117df
commit
99ae54e992
1
tests/.gitignore
vendored
Normal file
1
tests/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.urchin.log
|
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../urchin .fixture | grep '7 tests failed.'
|
||||
../../urchin .fixture | grep '7 tests passed.'
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../urchin .fixture | grep '3 tests passed.'
|
||||
../../urchin .fixture | grep '3 tests failed.'
|
||||
|
8
urchin
8
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 <test directory>"
|
||||
echo 'Go to http://www.urchin.sh for documentation on writing tests.'
|
||||
|
Loading…
Reference in New Issue
Block a user