]> mj.ucw.cz Git - eval.git/blobdiff - bin/lib
Renamed log() to msg() in order to avoid compiler warnings.
[eval.git] / bin / lib
diff --git a/bin/lib b/bin/lib
index 87d7100305a837acde774fef69be09b65247f6dd..237a89139141f97ee4d9608cd9e00c92faa4d210 100644 (file)
--- a/bin/lib
+++ b/bin/lib
@@ -227,7 +227,7 @@ function test-prolog
                file)   echo "Input file: $PROBLEM.in (from $PDIR/$TEST.in)"
                        try-ln $PDIR/$TEST.in $TDIR/$TEST.in
                        cp $PDIR/$TEST.in $BOXDIR/$PROBLEM.in
-                       BOX_EXTRAS="$BOX_EXTRAS -i/dev/null"
+                       [ $TASK_TYPE == interactive ] || BOX_EXTRAS="$BOX_EXTRAS -i/dev/null"
                        ;;
                stdio)  echo "Input file: <stdin> (from $PDIR/$TEST.in)"
                        try-ln $PDIR/$TEST.in $TDIR/$TEST.in
@@ -241,7 +241,7 @@ function test-prolog
        esac
        case $OUT_TYPE in
                file)   echo "Output file: $PROBLEM.out"
-                       BOX_EXTRAS="$BOX_EXTRAS -o/dev/null"
+                       [ $TASK_TYPE == interactive ] || BOX_EXTRAS="$BOX_EXTRAS -o/dev/null"
                        ;;
                stdio)  echo "Output file: <stdout>"
                        BOX_EXTRAS="$BOX_EXTRAS -o.stdout"
@@ -301,7 +301,7 @@ function test-run-interactive
        echo "Interactive checker: $ICCMD"
        if ! $HDIR/bin/iwrapper $BOXCMD $BOXOPTS -- ./$PROBLEM @@ $ICCMD 2>$TMPDIR/exec.out ; then
                cat $TMPDIR/exec.out
-               MSG="`tail -1 $TMPDIR/exec.out`"
+               MSG="`head -1 $TMPDIR/exec.out`"
                test-result 0 "$MSG"
        fi
        cat $TMPDIR/exec.out
@@ -329,19 +329,21 @@ function syntax-check
 
 function output-check
 {
-       [ -n "$OUTPUT_CHECK" ] || return 0
-       pcont "<check> "
-       [ -f $PDIR/$TEST.out ] && try-ln $PDIR/$TEST.out $TDIR/$TEST.ok
-       OCHECK=`eval echo $OUTPUT_CHECK`
-       echo "Output check command: $OCHECK"
-       if ! eval $OCHECK 2>$TMPDIR/exec.out ; then
+       MSG=
+       if [ -n "$OUTPUT_CHECK" -a "$OUT_TYPE" != none ] ; then
+               pcont "<check> "
+               [ -f $PDIR/$TEST.out ] && ln $PDIR/$TEST.out $TDIR/$TEST.ok
+               OCHECK=`eval echo $OUTPUT_CHECK`
+               echo "Output check command: $OCHECK"
+               if ! eval $OCHECK 2>$TMPDIR/exec.out ; then
+                       cat $TMPDIR/exec.out
+                       MSG=`tail -1 $TMPDIR/exec.out`
+                       if [ -z "$MSG" ] ; then MSG="Wrong answer." ; fi
+                       test-result 0 "$MSG"
+               fi
                cat $TMPDIR/exec.out
                MSG=`tail -1 $TMPDIR/exec.out`
-               if [ -z "$MSG" ] ; then MSG="Wrong answer." ; fi
-               test-result 0 "$MSG"
        fi
-       cat $TMPDIR/exec.out
-       MSG=`tail -1 $TMPDIR/exec.out`
        if [ -z "$MSG" ] ; then MSG="OK" ; fi
        test-result $POINTS_PER_TEST "$MSG"
 }