]> mj.ucw.cz Git - moe.git/commitdiff
Support partial score.
authorMartin Mares <mj@ucw.cz>
Thu, 3 Jul 2003 09:06:51 +0000 (09:06 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 3 Jul 2003 09:06:51 +0000 (09:06 +0000)
Handle compile errors gracefully.

README
bin/ev

diff --git a/README b/README
index 0320c50fae9b6090535d77cff5addba4d72a7f7e..f614d2958eeebb854647fac1a7b46c66fd0843c3 100644 (file)
--- a/README
+++ b/README
@@ -45,3 +45,9 @@ Don't use limits.conf for that since with sshd the limits would affect _root_
                ulimit -SHn 256         # max open files
                ulimit -SHv 262144      # max virtual memory
        fi
+
+
+Various notes:
+~~~~~~~~~~~~~~
+- if you want to assign partial score to testcases, just make the OUTPUT_CHECK
+  program generate a file $TDIR/$TEST.pts containing the score.
diff --git a/bin/ev b/bin/ev
index ad44b496594e950b071c9010a2df321322ac0e62..b2573b0958d3539520c2dab51026758e60d6f0cd 100755 (executable)
--- a/bin/ev
+++ b/bin/ev
@@ -1,6 +1,6 @@
 #!/bin/bash
 # The Evaluator -- Master Control Script
-# (c) 2001 Martin Mares <mj@ucw.cz>
+# (c) 2001--2003 Martin Mares <mj@ucw.cz>
 
 set -e
 if [ ! -f config -o ! -f bin/lib ] ; then
@@ -28,7 +28,7 @@ box-init
 
 # Compile the program
 locate-source $3
-compile
+compile || true
 
 # Perform the tests
 PTSFILE=$TDIR/points
@@ -36,18 +36,23 @@ for TEST in $TESTS ; do
        (
        [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config
        exec >$TDIR/$TEST.log
-       pstart "Test $TEST ($POINTS_PER_TEST points)... "
-       echo "Test $TEST ($POINTS_PER_TEST points)"
+       pstart "Test $TEST... "
+       echo "Test $TEST"
        echo >>$PTSFILE -n "$TEST "
        if [ ! -f $TDIR/$PROBLEM ] ; then
-               echo >$PTSFILE "0 Compile error."
+               echo >>$PTSFILE "0 Compile error."
                die "No executable file"
        fi
        test-run || exit 0
        syntax-check || exit 0
        output-check || exit 0
-       echo "Test completed OK ($POINTS_PER_TEST points)"
-       echo >>$PTSFILE "$POINTS_PER_TEST OK"
-       pend "OK"
+       if [ -f $TDIR/$TEST.pts ] ; then
+               PTS=`cat $TDIR/$TEST.pts`
+       else
+               PTS=$POINTS_PER_TEST
+       fi
+       echo "Test completed OK ($PTS points)"
+       echo >>$PTSFILE "$PTS OK"
+       pend "OK, $PTS points"
        )
 done