Browse Source

selftests: fib_tests: Add success-fail counts

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>
David Ahern 7 years ago
parent
commit
37ce42c14e
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tools/testing/selftests/net/fib_tests.sh

+ 7 - 0
tools/testing/selftests/net/fib_tests.sh

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