tests: Add errlist
authorJean Privat <jean@pryen.org>
Wed, 3 Jun 2009 16:31:50 +0000 (12:31 -0400)
committerJean Privat <jean@pryen.org>
Wed, 10 Jun 2009 13:59:35 +0000 (09:59 -0400)
Failed tests names are stored in a errlist.
The errlist can then be used to feed next tests.

Signed-off-by: Jean Privat <jean@pryen.org>

.gitignore
tests/tests.sh

index 3a61ae7..8b5a929 100644 (file)
@@ -23,3 +23,4 @@ tests/*.bin
 tests/*.err
 tests/*.write
 tests/alt
+tests/errlist
index 5b4de38..1f400bb 100755 (executable)
 # 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"