aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUwe Kleine-König <uwe@kleine-koenig.org>2019-01-31 09:49:59 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-07 21:56:50 +0100
commit4ba10f29f54214cfa39c5fc324ca45df55c4fecd (patch)
tree4d00a91d50d44c56aed2c3424226ab0f087710f6
parent950e23d1a5af3db635c9fea67a367326d847278e (diff)
downloadsparse-4ba10f29f54214cfa39c5fc324ca45df55c4fecd.tar.gz
validation: Add patterns FAIL, PASS, XPASS and XFAIL to test
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>
-rwxr-xr-xvalidation/test-suite15
1 files changed, 9 insertions, 6 deletions
diff --git a/validation/test-suite b/validation/test-suite
index f79a9023..64a3e08f 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