From: Jean Privat Date: Wed, 3 Jun 2009 16:31:50 +0000 (-0400) Subject: tests: Add errlist X-Git-Tag: v0.2.1~13 X-Git-Url: http://nitlanguage.org tests: Add errlist Failed tests names are stored in a errlist. The errlist can then be used to feed next tests. Signed-off-by: Jean Privat --- diff --git a/.gitignore b/.gitignore index 3a61ae7..8b5a929 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ tests/*.bin tests/*.err tests/*.write tests/alt +tests/errlist diff --git a/tests/tests.sh b/tests/tests.sh index 5b4de38..1f400bb 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -27,10 +27,24 @@ # Mark to distinguish files among tests # MARK= +# File where error tests are outputed +# Old ERRLIST is backuped +ERRLIST=${ERRLIST:-errlist} + if [ $# = 0 ]; then echo "usage: $0 file.nit ..." fi +# Backup and initiate new ERRLIST +if [ "x$ERRLIST" = "x" ]; then + ERRLIST=/dev=null +else + if [ -x "$ERRLIST" ]; then + mv "$ERRLIST" "${ERRLIST}.bak" + fi + > "$ERRLIST" +fi + ok="" nok="" @@ -90,6 +104,7 @@ for ii in "$@"; do else echo "[======= fail $ff.res sav/$ff.sav =======]" nok="$nok $ff" + echo "$ii" >> "$ERRLIST" fi else echo "[=== no sav ===] $ff.res" @@ -102,7 +117,7 @@ echo "ok: " `echo $ok | wc -w` "/" `echo $ok $nok $nos | wc -w` if [ -n "$nok" ]; then echo "fail: $nok" - echo "There were errors !" + echo "There were errors ! (see file $ERRLIST)" fi if [ -n "$nos" ]; then echo "no sav: $nos"