浏览代码

Fix infinite loop with usage()

Alois Mahdal 10 年前
父节点
当前提交
cbbfdb7146
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      test/runtests

+ 6
- 0
test/runtests 查看文件

@@ -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