From: Phil Sutter Date: Thu, 12 Dec 2024 12:47:33 +0000 (+0100) Subject: tests: runtest.sh: Keep running, print summary of failed tests X-Git-Tag: v7.23~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5872aeda8b0ff70d45bc0cb844e86d0795f08fe9;p=thirdparty%2Fipset.git tests: runtest.sh: Keep running, print summary of failed tests Do not exit at each failure. Signed-off-by: Phil Sutter Signed-off-by: Jozsef Kadlecsik --- diff --git a/tests/runtest.sh b/tests/runtest.sh index 7afa1dd..fc4fd3c 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -76,6 +76,7 @@ fi # Make sure the scripts are executable chmod a+x check_* *.sh +failcount=0 for types in $tests; do $ipset -X test >/dev/null 2>&1 if [ -f $types ]; then @@ -116,7 +117,8 @@ for types in $tests; do echo "FAILED" echo "Failed test: $cmd" cat .foo.err - exit 1 + let "failcount++" + break fi # sleep 1 done < $filename @@ -136,5 +138,9 @@ for x in $tests; do done rmmod ip_set >/dev/null 2>&1 rm -f .foo* -echo "All tests are passed" - +if [ "$failcount" -eq 0 ]; then + echo "All tests are passed" +else + echo "$failcount tests have failed" + exit 1 +fi