selftests: fib_tests: Add success-fail counts
authorDavid Ahern <dsahern@gmail.com>
Mon, 21 May 2018 17:26:54 +0000 (10:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 May 2018 18:44:18 +0000 (14:44 -0400)
As more tests are added, it is convenient to have a tally at the end.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/fib_tests.sh

index 9164e60d4b66c88100bc8c43e2c59102265d96a1..7e2291161e1570841b35e93260244c8220a4f1eb 100755 (executable)
@@ -18,8 +18,10 @@ log_test()
 
        if [ ${rc} -eq ${expected} ]; then
                printf "    TEST: %-60s  [ OK ]\n" "${msg}"
+               nsuccess=$((nsuccess+1))
        else
                ret=1
+               nfail=$((nfail+1))
                printf "    TEST: %-60s  [FAIL]\n" "${msg}"
                if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
                echo
@@ -598,4 +600,9 @@ cleanup &> /dev/null
 
 fib_test
 
+if [ "$TESTS" != "none" ]; then
+       printf "\nTests passed: %3d\n" ${nsuccess}
+       printf "Tests failed: %3d\n"   ${nfail}
+fi
+
 exit $ret