fixing timeout flag

This commit is contained in:
Thomas Levine 2016-04-04 01:16:51 +00:00
parent a486a6f296
commit 72f0700598
2 changed files with 12 additions and 3 deletions

View File

@ -1,2 +1,2 @@
../../urchin -T .testsuite 2>&1 |
grep positive\ number
../../urchin -T aoeu .testsuite 2>&1 | grep positive\ number
../../urchin -T .testsuite 2>&1 | grep positive\ number

11
urchin
View File

@ -585,7 +585,16 @@ main() {
;;
-n|--disable-cycling) cycle_shell=false;;
-t|--tap) tap_format=true;;
-T|--timeout) shift; urchin_timeout="${1}" ;;
-T|--timeout)
shift
urchin_timeout="${1}"
if ! {
echo "${urchin_timeout}" |
grep '[0-9][0-9.]*\(s\|m\|h\|d\|\)'
}; then
echo Bad timeout argument: "${urchin_timeout}" >&2
urchin_exit 1
fi ;;
-p|--pretty) print_in_color=true;;
-q|--quiet) print_not_ok=false