1
0
mirror of https://github.com/sstephenson/bats.git synced 2026-02-26 01:38:11 +01:00

bats -c filename prints the number of tests in the file

This commit is contained in:
Sam Stephenson
2012-04-08 23:25:19 -05:00
parent 3f82256855
commit 6b965e18c4
3 changed files with 30 additions and 3 deletions

View File

@@ -40,14 +40,20 @@ if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
exit 0
fi
count_only=""
if [ "$1" = "-c" ]; then
count_only="-c"
shift
fi
filename="$1"
if [ -z "$filename" ]; then
{ version
echo "usage: $0 <filename>"
echo "usage: $0 [-c] <filename>"
} >&2
exit 1
else
shift
fi
exec bats-exec "$(expand_path "$filename")" "$@"
exec bats-exec $count_only "$(expand_path "$filename")" "$@"