]> mj.ucw.cz Git - moe.git/blob - bin/ev-open
Copy only dotfiles from the template dir (not CVS/*).
[moe.git] / bin / ev-open
1 #!/bin/bash
2 # The Evaluator for Open Data Problems
3 # (c) 2001 Martin Mares <mj@ucw.cz>
4
5 set -e
6 if [ ! -f config -o ! -f bin/lib ] ; then
7         echo "Unable to find evaluator files!"
8         exit 1
9 fi
10 . bin/lib
11 . config
12
13 # Set up environment:
14 #   HDIR        home dir of the evaluator
15 #   PDIR        problem specific data
16 #   SDIR        contestant's solution
17 #   TDIR        test results
18 #   BOXDIR      sandbox
19 #   PROBLEM     problem we're evaluating
20
21 [ -n "$2" ] || die "Usage: ev-open <contestant> <problem>"
22 CONTESTANT=$1
23 PROBLEM=$2
24 dir-init
25 log-init
26 . $PDIR/config
27
28 # Perform the tests
29 PTSFILE=$TDIR/points
30 for TEST in $TESTS ; do
31         (
32         [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config
33         exec >$TDIR/$TEST.log
34         pstart "Test $TEST ($POINTS_PER_TEST points)... "
35         echo "Test $TEST ($POINTS_PER_TEST points)"
36         echo >>$PTSFILE -n "$TEST "
37         if [ ! -f $SDIR/$TEST.out ] ; then
38                 echo >>$PTSFILE "0 No solution."
39                 die "No solution."
40         fi
41         syntax-check || exit 0
42         output-check || exit 0
43         echo "Test completed OK ($POINTS_PER_TEST points)"
44         echo >>$PTSFILE "$POINTS_PER_TEST OK"
45         pend "OK"
46         )
47 done