X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=public%2Fcheck;h=be2f99fc0479ac29ce63fe5420fd69cade4854f4;hb=9306a593e097b30b55196f0fb7dd7c189389a0d3;hp=ea6512da50b354fe89879a728611e0392aa77d8d;hpb=210b070496ef912a3b4745477b609b150b013d6b;p=eval.git diff --git a/public/check b/public/check index ea6512d..be2f99f 100644 --- a/public/check +++ b/public/check @@ -1,32 +1,40 @@ # The Evaluator -- Public Checking Script -# (c) 2001 Martin Mares +# (c) 2001--2004 Martin Mares set -e -[ -n "$MO_PUBLIC" -a -d "$MO_PUBLIC" ] || { echo >&2 "MO_PUBLIC not set, giving up." ; exit 1 ; } -. $MO_PUBLIC/bin/lib -. $MO_PUBLIC/config +[ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; } +. $MO_ROOT/bin/lib +. $MO_ROOT/config -[ -n "$1" ] || die "Usage: check []" +[ -n "$1" ] || die "Usage: check []" PROBLEM=$1 public-setup . $PDIR/config -PTSFILE=$TDIR/points -if [ -n "$OPEN_DATA_PROBLEM" ] ; then + +function test-verdict +{ + pend "$2" + exit 0 +} + +if [ $TASK_TYPE == open-data ] ; then [ -n "$2" ] || die "You need to specify test number for open data problems." TEST=$2 - open-locate pstart "Checking $TEST: " + open-locate + ln $SRCN $TDIR/$TEST.out syntax-check - pend "OK" + test-result 1 OK else - [ -z "$2" ] || die "No test number should be specified for normal problems." + [ -z "$2" ] || die "Test number should be given only for open data problems." locate-source compile for TEST in $SAMPLE_TESTS ; do + ( pstart "Checking on sample input $TEST: " test-run syntax-check output-check - pend "OK" + ) done fi