From: Omar Sandoval Date: Thu, 11 May 2017 19:50:04 +0000 (-0700) Subject: check: fix tests getting run twice X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=adbde366afb1dd6cb78e5173c578fd35d001407c;p=users%2Fsagi%2Fblktests.git check: fix tests getting run twice Another dumb mistake. Signed-off-by: Omar Sandoval --- diff --git a/check b/check index c7ad042..59bfe1e 100755 --- 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