Skip to content

Commit

Permalink
validation: Add patterns FAIL, PASS, XPASS and XFAIL to test
Browse files Browse the repository at this point in the history
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@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
  • Loading branch information
ukleinek authored and lucvoo committed Feb 7, 2019
1 parent 950e23d commit 4ba10f2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions validation/test-suite
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -183,22 +182,19 @@ 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
continue
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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4ba10f2

Please sign in to comment.