From 5872aeda8b0ff70d45bc0cb844e86d0795f08fe9 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 12 Dec 2024 13:47:33 +0100 Subject: 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 --- tests/runtest.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- cgit v1.2.3