From 0f5aaa6fd6a30a58f7aa8cd83507fd803d59128a Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 3 Jul 2003 09:06:51 +0000 Subject: [PATCH] Support partial score. Handle compile errors gracefully. --- README | 6 ++++++ bin/ev | 21 +++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README b/README index 0320c50..f614d29 100644 --- 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 ad44b49..b2573b0 100755 --- a/bin/ev +++ b/bin/ev @@ -1,6 +1,6 @@ #!/bin/bash # The Evaluator -- Master Control Script -# (c) 2001 Martin Mares +# (c) 2001--2003 Martin Mares 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 -- 2.39.2