From be5286967e8123798d24d3fbe9a938c3f93a851f Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Wed, 3 Jun 2009 12:31:50 -0400 Subject: [PATCH] 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 --- .gitignore | 1 + tests/tests.sh | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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" -- 1.7.9.5