Merge branch 'dump_rta'
[nit.git] / tests / tests.sh
index e9870ab..87e4db1 100755 (executable)
@@ -145,6 +145,7 @@ function process_result()
                        remains="$remains $OLD"
                else
                        echo "[fixme] out/$pattern.res $FIXME"
+                       echo >>$xml "<skipped/>"
                fi
                todos="$todos $pattern"
        elif [ -n "$SOSO" ]; then
@@ -159,6 +160,7 @@ function process_result()
                        echo "not ok - $description # TODO not yet implemented"
                else
                        echo "[todo] out/$pattern.res -> not yet implemented"
+                       echo >>$xml "<skipped/>"
                fi
                todos="$todos $pattern"
        elif [ -n "$SOSOF" ]; then
@@ -166,6 +168,7 @@ function process_result()
                        echo "not ok - $description # TODO SOSO expected failure"
                else
                        echo "[fixme soso] out/$pattern.res $SOSOF"
+                       echo >>$xml "<skipped/>"
                fi
                todos="$todos $pattern"
        elif [ -n "$NSAV" ]; then
@@ -176,7 +179,7 @@ function process_result()
                fi
                echo >>$xml "<error message='fail out/$pattern.res $NSAV'/>"
                echo >>$xml "<system-out><![CDATA["
-               head >>$xml -n 50 out/$pattern.diff.sav.log
+               cat -v out/$pattern.diff.sav.log | head >>$xml -n 50
                echo >>$xml "]]></system-out>"
                nok="$nok $pattern"
                echo "$ii" >> "$ERRLIST"
@@ -188,7 +191,7 @@ function process_result()
                fi
                echo >>$xml "<error message='changed out/$pattern.res $NFIXME'/>"
                echo >>$xml "<system-out><![CDATA["
-               head >>$xml -n 50 out/$pattern.diff.sav.log
+               cat -v out/$pattern.diff.sav.log | head >>$xml -n 50
                echo >>$xml "]]></system-out>"
                nok="$nok $pattern"
                echo "$ii" >> "$ERRLIST"
@@ -200,13 +203,13 @@ function process_result()
                fi
                echo >>$xml "<skipped/>"
                echo >>$xml "<system-out><![CDATA["
-               cat  >>$xml out/$pattern.res
+               cat -v >>$xml out/$pattern.res
                echo >>$xml "]]></system-out>"
                nos="$nos $pattern"
        fi
        if test -s out/$pattern.cmp.err; then
                echo >>$xml "<system-err><![CDATA["
-               cat  >>$xml out/$pattern.cmp.err
+               cat -v >>$xml out/$pattern.cmp.err
                echo >>$xml "]]></system-err>"
        fi
        echo >>$xml "</testcase>"
@@ -299,6 +302,14 @@ case $engine in
                enginebinname=nit
                savdirs="sav/$engine/fixme/ sav/$engine/ sav/fixme/ sav/"
                ;;
+       nitc)
+               echo "disabled engine $engine"
+               exit 0
+               ;;
+       *)
+               echo "unknown engine $engine"
+               exit 1
+               ;;
 esac
 
 # The default nitc compiler
@@ -440,6 +451,13 @@ END
                                        # Sould we skip the input for this engine?
                                        need_skip $bff "  $name" $pack && continue
 
+                                       # use a specific inputs file, if required
+                                       if [ -f "$bff.inputs" ]; then
+                                               ffinputs="$bff.inputs"
+                                       else
+                                               ffinputs=$inputs
+                                       fi
+
                                        rm -rf "$fff.res" "$fff.err" "$fff.write" 2> /dev/null
                                        if [ "x$verbose" = "xtrue" ]; then
                                                echo ""
@@ -448,7 +466,7 @@ END
                                        test -z "$tap" && echo -n "==> $name "
                                        echo "./$ff.bin $args" > "./$fff.bin"
                                        chmod +x "./$fff.bin"
-                                       sh -c "NIT_NO_STACK=1 $TIMEOUT ./$fff.bin < $inputs > $fff.res 2>$fff.err"
+                                       WRITE="$fff.write" sh -c "NIT_NO_STACK=1 $TIMEOUT ./$fff.bin < $ffinputs > $fff.res 2>$fff.err"
                                        if [ "x$verbose" = "xtrue" ]; then
                                                cat "$fff.res"
                                                cat >&2 "$fff.err"