[PATCH] validation: Add patterns FAIL, PASS, XPASS and XFAIL to test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>

This simplifies finding the offending test when the build ended with

	KO: out of 584 tests, 527 passed, 57 failed
		56 of them are known to fail

Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---

Changes from the original version:
*) remove the "error: test '...' failed" for patterns since it's
   now redundant with the summary XFAIL line.
*) only outputs the PASS line in verbose mode.

 validation/test-suite | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/validation/test-suite b/validation/test-suite
index f79a9023d..64a3e08fb 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -138,7 +138,6 @@ has_patterns()
 	while read val; do
 		grep -s -q "$val" "$ofile"
 		if [ "$?" $cmp 0 ]; then
-			error "test '$ifile' failed"
 			error "	Pattern '$val' unexpectedly $msg"
 			return 1
 		fi
@@ -183,7 +182,6 @@ minmax_patterns()
 		n=$(grep -s "$pat" "$ofile" | wc -l)
 		if [ "$max" = "eq" ]; then
 		    if [ "$n" -ne "$min" ]; then
-			error "test '$ifile' failed"
 			error "	Pattern '$pat' expected $min times but got $n times"
 			return 1
 		    fi
@@ -191,14 +189,12 @@ minmax_patterns()
 		fi
 		if [ "$min" != '-' ]; then
 		    if [ "$n" -lt "$min" ]; then
-			error "test '$ifile' failed"
 			error "	Pattern '$pat' expected min $min times but got $n times"
 			return 1
 		    fi
 		fi
 		if [ "$max" != '-' ]; then
 		    if [ "$n" -gt "$max" ]; then
-			error "test '$ifile' failed"
 			error "	Pattern '$pat' expected max $max times but got $n times"
 			return 1
 		    fi
@@ -403,9 +399,16 @@ do_test()
 	if [ "$must_fail" -eq "1" ]; then
 		if [ "$test_failed" -eq "1" ]; then
 			[ -z "$vquiet" ] && \
-			echo "info: test '$file' is known to fail"
+			echo "info: XFAIL: test '$file' is known to fail"
 		else
-			echo "error: test '$file' is known to fail but succeed!"
+			echo "error: XPASS: test '$file' is known to fail but succeed!"
+		fi
+	else
+		if [ "$test_failed" -eq "1" ]; then
+			echo "error: FAIL: test '$file' failed"
+		else
+			[ "$V" -ne "0" ] && \
+			echo "info: PASS: test '$file' passed"
 		fi
 	fi
 
-- 
2.20.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux