#!/bin/bash # The Evaluator -- Public Checking Script # (c) 2001--2004 Martin Mares set -e [ -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 []" PROBLEM=$1 public-setup . $PDIR/config function test-verdict { pend "$2" if [ $1 == 0 ] ; then exit 1 else exit 0 fi } if [ $TASK_TYPE == open-data ] ; then [ -n "$2" ] || die "You need to specify test number for open data problems." TEST=$2 pstart "Checking $TEST: " open-locate ln $SRCN $TDIR/$TEST.out syntax-check test-result 1 OK else [ -z "$2" ] || die "Test number should be given only for open data problems." locate-source compile RC=0 for TEST in $SAMPLE_TESTS ; do ( pstart "Checking on sample input $TEST: " test-run syntax-check output-check ) || RC=1 done exit $RC fi