1 # The Evaluator -- Master Control Script
2 # (c) 2001 Martin Mares <mj@ucw.cz>
8 [ -n "$TEST_USER" ] || die "TEST_USER not set. Please fix."
9 [ -d $MO_ROOT/$TEST_USER ] || die "TEST_USER set incorrectly. Please fix."
10 [ -n "$2" ] || die "Usage: ev <contestant> <problem>"
15 # Initialize the testing directory
16 echo >&2 "Testing contestant $CT, problem $PROBLEM"
18 PDIR=problems/$PROBLEM
19 SDIR=solutions/$CT/$PROBLEM
20 TDIR=testing/$CT/$PROBLEM
28 # Compile the solution
29 ( . bin/task-compile )
32 for TEST in $TESTS ; do
35 [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config
37 PTSFILE=$TDIR/$TEST.pts
38 if [ ! -f $TDIR/compile.out ] ; then
42 if [ ! -f $TDIR/$PROBLEM ] ; then
44 die "No executable file"
48 echo "Executable file: $TDIR/$PROBLEM"
49 cp $TDIR/$PROBLEM $BOXDIR/
50 echo "Input: $TDIR/$PROBLEM"
51 cp $PDIR/$TEST.in $BOXDIR/$PROBLEM.in
54 echo "Timeout: $TIME_LIMIT s"
55 echo "Memory: $MEM_LIMIT KB"
56 BOXOPTS="`eval echo $TEST_SANDBOX_OPTS`"
57 echo "Sandbox options: $BOXOPTS"
61 echo "Test completed OK ($POINTS_PER_TEST points)"
62 echo >$PTSFILE "$POINTS_PER_TEST OK"