Check return value correctly (for both error and non-error).

svn path=/trunk/yasm/; revision=616
0.3
Peter Johnson 23 years ago
parent f9674f719d
commit c7dee53ad5
  1. 40
      modules/objfmts/bin/tests/objfmt_test.sh
  2. 40
      src/objfmts/bin/tests/objfmt_test.sh

@ -30,7 +30,8 @@ do
echo " FAIL (crashed)."
failedct=`expr $failedct + 1`
elif test $status -gt 0; then
if `echo ${asm} | grep err`; then
echo ${asm} | grep err >/dev/null
if test $? -gt 0; then
# YASM detected errors but shouldn't have!
echo " FAIL."
failedct=`expr $failedct + 1`
@ -52,29 +53,36 @@ do
fi
fi
else
echo " PASS."
passedct=`expr $passedct + 1`
echo -n "$OT: Testing bin objfmt for ${a} output file ..."
hexdump -e '1/1 "%02x " "\n"' ${o} > ${oh}
if diff -w ${og} ${oh} > /dev/null; then
echo ${asm} | grep -v err >/dev/null
if test $? -gt 0; then
# YASM detected errors but shouldn't have!
echo " FAIL."
failedct=`expr $failedct + 1`
else
echo " PASS."
passedct=`expr $passedct + 1`
echo -n "$OT: Testing bin objfmt for ${a} error/warnings ..."
cat ${e} | sed -e "s,${srcdir}/,./," >${e}.2
mv ${e}.2 ${e}
if diff -w ${eg} ${e} > /dev/null; then
# Both object file and error/warnings match, it passes!
echo -n "$OT: Testing bin objfmt for ${a} output file ..."
hexdump -e '1/1 "%02x " "\n"' ${o} > ${oh}
if diff -w ${og} ${oh} > /dev/null; then
echo " PASS."
passedct=`expr $passedct + 1`
echo -n "$OT: Testing bin objfmt for ${a} error/warnings ..."
cat ${e} | sed -e "s,${srcdir}/,./," >${e}.2
mv ${e}.2 ${e}
if diff -w ${eg} ${e} > /dev/null; then
# Both object file and error/warnings match, it passes!
echo " PASS."
passedct=`expr $passedct + 1`
else
# Error/warnings don't match.
echo " FAIL."
failedct=`expr $failedct + 1`
fi
else
# Error/warnings don't match.
# Object file doesn't match.
echo " FAIL."
failedct=`expr $failedct + 1`
fi
else
# Object file doesn't match.
echo " FAIL."
failedct=`expr $failedct + 1`
fi
fi
done

@ -30,7 +30,8 @@ do
echo " FAIL (crashed)."
failedct=`expr $failedct + 1`
elif test $status -gt 0; then
if `echo ${asm} | grep err`; then
echo ${asm} | grep err >/dev/null
if test $? -gt 0; then
# YASM detected errors but shouldn't have!
echo " FAIL."
failedct=`expr $failedct + 1`
@ -52,29 +53,36 @@ do
fi
fi
else
echo " PASS."
passedct=`expr $passedct + 1`
echo -n "$OT: Testing bin objfmt for ${a} output file ..."
hexdump -e '1/1 "%02x " "\n"' ${o} > ${oh}
if diff -w ${og} ${oh} > /dev/null; then
echo ${asm} | grep -v err >/dev/null
if test $? -gt 0; then
# YASM detected errors but shouldn't have!
echo " FAIL."
failedct=`expr $failedct + 1`
else
echo " PASS."
passedct=`expr $passedct + 1`
echo -n "$OT: Testing bin objfmt for ${a} error/warnings ..."
cat ${e} | sed -e "s,${srcdir}/,./," >${e}.2
mv ${e}.2 ${e}
if diff -w ${eg} ${e} > /dev/null; then
# Both object file and error/warnings match, it passes!
echo -n "$OT: Testing bin objfmt for ${a} output file ..."
hexdump -e '1/1 "%02x " "\n"' ${o} > ${oh}
if diff -w ${og} ${oh} > /dev/null; then
echo " PASS."
passedct=`expr $passedct + 1`
echo -n "$OT: Testing bin objfmt for ${a} error/warnings ..."
cat ${e} | sed -e "s,${srcdir}/,./," >${e}.2
mv ${e}.2 ${e}
if diff -w ${eg} ${e} > /dev/null; then
# Both object file and error/warnings match, it passes!
echo " PASS."
passedct=`expr $passedct + 1`
else
# Error/warnings don't match.
echo " FAIL."
failedct=`expr $failedct + 1`
fi
else
# Error/warnings don't match.
# Object file doesn't match.
echo " FAIL."
failedct=`expr $failedct + 1`
fi
else
# Object file doesn't match.
echo " FAIL."
failedct=`expr $failedct + 1`
fi
fi
done

Loading…
Cancel
Save