Friday, 16 February 2024

[netsurf-dev] [PATCH] test: nsgif: make failing tests fatal

Right now, failing tests is not currently considered fatal, and also the
definitions of "error" vs "failure" are reversed from how they are
usually intended. This corrects the usage and makes any instance of
either fatal.

See: https://github.com/gentoo/gentoo/pull/35142
---
test/runtest.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/runtest.sh b/test/runtest.sh
index fd84847..27f45f2 100755
--- a/test/runtest.sh
+++ b/test/runtest.sh
@@ -53,14 +53,14 @@ for GIF in $(ls ${GIFTESTS});do
#echo "${GIF}"
gifdecode ${GIF}
ECODE=$?
- if [ "${ECODE}" -gt 127 ];then
- GIFTESTERRC=$((GIFTESTERRC+1))
- echo "Error ${GIF}"
+ if [ "${ECODE}" -eq 0 ];then
+ GIFTESTPASSC=$((GIFTESTPASSC+1))
else
- if [ "${ECODE}" -gt 0 ];then
- GIFTESTFAILC=$((GIFTESTFAILC+1))
+ if [ "${ECODE}" -gt 127 ];then
+ GIFTESTERRC=$((GIFTESTERRC+1))
+ echo "Error ${GIF}"
else
- GIFTESTPASSC=$((GIFTESTPASSC+1))
+ GIFTESTFAILC=$((GIFTESTFAILC+1))
fi
fi
done
@@ -68,7 +68,7 @@ done
echo "Tests:${GIFTESTTOTC} Pass:${GIFTESTPASSC} Fail:${GIFTESTFAILC}
Error:${GIFTESTERRC}"

# exit code
-if [ "${GIFTESTERRC}" -gt 0 ]; then
+if [ "${GIFTESTERRC}" -gt 0 ] || [ "${GIFTESTFAILC}" -gt 0 ]; then
exit 1
fi

--
2.43.1

No comments:

Post a Comment