]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
check: fix tests getting run twice
authorOmar Sandoval <osandov@fb.com>
Thu, 11 May 2017 19:50:04 +0000 (12:50 -0700)
committerOmar Sandoval <osandov@fb.com>
Thu, 11 May 2017 19:50:04 +0000 (12:50 -0700)
Another dumb mistake.

Signed-off-by: Omar Sandoval <osandov@fb.com>
check

diff --git a/check b/check
index c7ad042459c2b0ed3ef7c32e743c82a2c521a6c9..59bfe1ee693df6c45c505a87ef8099a039e26f4e 100755 (executable)
--- a/check
+++ b/check
@@ -388,11 +388,6 @@ _run_test() {
 
 _run_group() {
        local tests=("$@")
-
-       if [[ ${#tests} -eq 0 ]]; then
-               return 0
-       fi
-
        local group="${tests[0]%/*}"
 
        . "tests/${group}/group"
@@ -473,15 +468,20 @@ _check() {
                group="${test_name%/*}"
                if [[ $group != $prev_group ]]; then
                        prev_group="$group"
-                       if ! ( _run_group "${tests[@]}" ); then
-                               ret=1
+                       if [[ ${#tests[@]} -gt 0 ]]; then
+                               if ! ( _run_group "${tests[@]}" ); then
+                                       ret=1
+                               fi
+                               tests=()
                        fi
                fi
                tests+=("$test_name")
        done < <(_find_tests "$@" | sort -zu)
 
-       if ! ( _run_group "${tests[@]}" ); then
-               ret=1
+       if [[ ${#tests[@]} -gt 0 ]]; then
+               if ! ( _run_group "${tests[@]}" ); then
+                       ret=1
+               fi
        fi
 
        return $ret