box-init
# Compile the program
-locate-source `if [ -n "$3" ] ; then echo $SDIR/$3 ; fi`
-compile || true
+if [ $TASK_TYPE != open-data ] ; then
+ locate-source `if [ -n "$3" ] ; then echo $SDIR/$3 ; fi`
+ compile || true
+fi
# Initialize the points file
PTSFILE=$TDIR/points
+++ /dev/null
-#!/bin/bash
-# The Evaluator for Open Data Problems
-# (c) 2001--2004 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
-
-[ -n "$2" ] || die "Usage: ev-open <contestant> <problem>"
-CONTESTANT=$1
-PROBLEM=$2
-dir-init
-log-init
-. $PDIR/config
-
-# 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
-PTSFILE=$TDIR/points
-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)"
- [ -f $SDIR/$TEST.out ] || test-result 0 "No solution."
- ln $SDIR/$TEST.out $TDIR/$TEST.out
- syntax-check
- output-check
- die "You must never see this message."
- )
-done
test-epilog
}
+# "Running" of open-data problems
+
+function test-run-open-data
+{
+ [ -f $SDIR/$TEST.out ] || test-result 0 "No solution."
+ ln $SDIR/$TEST.out $TDIR/$TEST.out
+}
+
# Syntax checks
function syntax-check
+++ /dev/null
-#!/bin/bash
-
-[ -n "$1" ] || { echo "Usage: mo-ev-open-all <tasks>" ; exit 1 ; }
-
-while [ -n "$1" ] ; do
- for user in `bin/mo-get-users` ; do
- echo -e "\n### USER $user TASK $1 ###\n"
- bin/ev-open $user $1
- done
- shift
-done