]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: Summarize failures per test case
authorPhil Sutter <phil@nwl.cc>
Thu, 20 Jul 2023 10:08:45 +0000 (12:08 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 20 Jul 2023 10:49:21 +0000 (12:49 +0200)
Explicitly print when tests from a file fail in addition to the diff +
"output differs" message.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/monitor/run-tests.sh

index b5ca47d9838e49cf1203c01e0b290238c83c7469..f1ac790acf80c343f8b30adaf073517f031b643e 100755 (executable)
@@ -161,7 +161,10 @@ for variant in $variants; do
        output_append=${variant}_output_append
 
        for testcase in ${testcases:-testcases/*.t}; do
-               echo "$variant: running tests from file $(basename $testcase)"
+               filename=$(basename $testcase)
+               echo "$variant: running tests from file $filename"
+               rc_start=$rc
+
                # files are like this:
                #
                # I add table ip t
@@ -199,6 +202,10 @@ for variant in $variants; do
                        $run_test
                        let "rc += $?"
                }
+
+               let "rc_diff = rc - rc_start"
+               [[ $rc_diff -ne 0 ]] && \
+                       echo "$variant: $rc_diff tests from file $filename failed"
        done
 done
 exit $rc