]> mj.ucw.cz Git - eval.git/commitdiff
Added evaluator for open data problems.
authorMartin Mares <mj@ucw.cz>
Fri, 8 Jun 2001 15:32:28 +0000 (15:32 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 8 Jun 2001 15:32:28 +0000 (15:32 +0000)
bin/ev-open [new file with mode: 0755]

diff --git a/bin/ev-open b/bin/ev-open
new file mode 100755 (executable)
index 0000000..735baf2
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/bash
+# The Evaluator for Open Data Problems
+# (c) 2001 Martin Mares <mj@ucw.cz>
+
+set -e
+if [ ! -f config -o ! -f bin/lib ] ; then
+       echo "Unable to find evaluator files!"
+       exit 1
+fi
+. bin/lib
+. config
+
+# Set up environment:
+#   HDIR       home dir of the evaluator
+#   PDIR       problem specific data
+#   SDIR       contestant's solution
+#   TDIR       test results
+#   BOXDIR     sandbox
+#   PROBLEM    problem we're evaluating
+
+[ -n "$2" ] || die "Usage: ev-open <contestant> <problem>"
+CONTESTANT=$1
+PROBLEM=$2
+dir-init
+log-init
+. $PDIR/config
+
+# Perform the tests
+PTSFILE=$TDIR/points
+for TEST in $TESTS ; do
+       (
+       [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config
+       exec >$TDIR/$TEST.log
+       pstart "Test $TEST ($POINTS_PER_TEST points)... "
+       echo "Test $TEST ($POINTS_PER_TEST points)"
+       echo >>$PTSFILE -n "$TEST "
+       if [ ! -f $SDIR/$TEST.out ] ; then
+               echo >>$PTSFILE "0 No solution."
+               die "No solution."
+       fi
+       syntax-check || exit 0
+       output-check || exit 0
+       echo "Test completed OK ($POINTS_PER_TEST points)"
+       echo >>$PTSFILE "$POINTS_PER_TEST OK"
+       pend "OK"
+       )
+done