diff --git a/tests/Flags/--timeout error message b/tests/Flags/--timeout error message index e8143e6..d38fdb6 100755 --- a/tests/Flags/--timeout error message +++ b/tests/Flags/--timeout error message @@ -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 diff --git a/urchin b/urchin index 2c30c22..08fcbf8 100755 --- a/urchin +++ b/urchin @@ -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