tests: a res without sav is OK if empty else is failed
authorJean Privat <jean@pryen.org>
Sat, 26 Apr 2014 02:21:31 +0000 (22:21 -0400)
committerJean Privat <jean@pryen.org>
Sat, 26 Apr 2014 14:39:22 +0000 (10:39 -0400)
This will simplify the addition of sav, that are required only if not
empty.
Moreover, a missing non-empty sav will triggers a FAIL instead of a
skip.

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

tests/tests.sh

index 9b42cb3..956c0ab 100755 (executable)
@@ -206,17 +206,25 @@ function process_result()
                echo >>$xml "]]></system-out>"
                nok="$nok $pattern"
                echo "$ii" >> "$ERRLIST"
-       else
+       elif [ -s out/$pattern.res ]; then
                if [ -n "$tap" ]; then
-                       echo "ok - $description # skip no sav"
+                       echo "no ok - $description"
                else
-                       echo "[=== no sav ===] out/$pattern.res"
+                       echo "[=== no sav ===] out/$pattern.res is not empty"
                fi
-               echo >>$xml "<skipped/>"
+               echo >>$xml "<error message='no sav and not empty'/>"
                echo >>$xml "<system-out><![CDATA["
                cat -v >>$xml out/$pattern.res
                echo >>$xml "]]></system-out>"
                nos="$nos $pattern"
+       else
+               # no sav but empty res
+               if [ -n "$tap" ]; then
+                       echo "ok - $description"
+               else
+                       echo "[0k] out/$pattern.res is empty"
+               fi
+               ok="$ok $pattern"
        fi
        if test -s out/$pattern.cmp.err; then
                echo >>$xml "<system-err><![CDATA["