From 785567d13d74d89796cb251b1945fe9a0ab39220 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 3 Jul 2007 10:14:40 +0200 Subject: [PATCH] `ev' is now able to process open-data problems. Removed ev-open and ev-open-all. --- bin/ev | 6 ++++-- bin/ev-open | 49 ---------------------------------------------- bin/lib | 8 ++++++++ bin/mo-ev-open-all | 11 ----------- 4 files changed, 12 insertions(+), 62 deletions(-) delete mode 100755 bin/ev-open delete mode 100755 bin/mo-ev-open-all diff --git a/bin/ev b/bin/ev index 8e46028..1681d93 100755 --- a/bin/ev +++ b/bin/ev @@ -19,8 +19,10 @@ log-init 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 diff --git a/bin/ev-open b/bin/ev-open deleted file mode 100755 index 663943e..0000000 --- a/bin/ev-open +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# The Evaluator for Open Data Problems -# (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" ] || die "Usage: ev-open " -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 diff --git a/bin/lib b/bin/lib index e62db7e..a186e1c 100644 --- a/bin/lib +++ b/bin/lib @@ -314,6 +314,14 @@ function test-run-interactive 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 diff --git a/bin/mo-ev-open-all b/bin/mo-ev-open-all deleted file mode 100755 index f16ce2a..0000000 --- a/bin/mo-ev-open-all +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -[ -n "$1" ] || { echo "Usage: mo-ev-open-all " ; 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 -- 2.39.5