#!/bin/bash # The Evaluator -- Master Control Script # (c) 2001--2004 Martin Mares set -e if [ ! -f config -o ! -f bin/lib ] ; then echo "Unable to find evaluator files!" exit 1 fi . bin/lib . config [ -n "$2" -a -z "$4" ] || die "Usage: ev []" CONTESTANT=$1 PROBLEM=$2 dir-init log-init . $PDIR/config box-init # Compile the program locate-source $3 compile || true # Initialize the points file PTSFILE=$TDIR/points >$PTSFILE function test-verdict { if [ $1 == 0 ] ; then pend "$2" else pend "$2 ($1 points)" fi echo >>$PTSFILE "$TEST $1 $2" exit 0 } # Perform the tests for TEST in $TESTS ; do ( [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config exec >$TDIR/$TEST.log pstart "Test $TEST... " echo "Test $TEST ($POINTS_PER_TEST points)" test-run syntax-check output-check die "You must never see this message." ) done