Pārlūkot izejas kodu

Fix infinite loop with usage()

Alois Mahdal 9 gadus atpakaļ
vecāks
revīzija
cbbfdb7146
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6
    0
      test/runtests

+ 6
- 0
test/runtests Parādīt failu

@@ -8,6 +8,11 @@ export LC_ALL=C
8 8
 
9 9
 export TF_PROJDIR="$PWD"
10 10
 
11
+usage() {
12
+    echo "usage: $(basename $0) [-c] [-t tests_re] [-s subtest_re] [-p binpath] [-v] [-d]" >&2
13
+    exit 2
14
+}
15
+
11 16
 while true; do case "$1" in
12 17
     -c|--collect)           export TF_COLLECT=always; shift ;;
13 18
     -t|--filter-test)       export TF_FILTER_TEST="$2"; shift 2 ;;
@@ -16,6 +21,7 @@ while true; do case "$1" in
16 21
     -d|--debug)             export TF_DEBUG=true; shift ;;
17 22
     -v|--verbose)           export TF_VERBOSE=true; shift ;;
18 23
     "") break ;;
24
+    *)  usage ;;
19 25
 esac done
20 26
 
21 27
 time tf_run_tests