]> mj.ucw.cz Git - eval.git/blobdiff - public/check
mo-create-logins - generates logins and passwords for eval and users
[eval.git] / public / check
index 37fce3035e7a64712aa3305c3ade81f341a42420..ce9a86b9453622b16e15d7d7278a943dc02aef6e 100644 (file)
@@ -1,20 +1,40 @@
 # The Evaluator -- Public Checking Script
-# (c) 2001 Martin Mares <mj@ucw.cz>
+# (c) 2001--2004 Martin Mares <mj@ucw.cz>
 
 set -e
 [ -n "$MO_PUBLIC" -a -d "$MO_PUBLIC" ] || { echo >&2 "MO_PUBLIC not set, giving up." ; exit 1 ; }
 . $MO_PUBLIC/bin/lib
 . $MO_PUBLIC/config
 
-[ -n "$1" ] || die "Usage: check <problem>"
+[ -n "$1" ] || die "Usage: check <problem> [<test-number>]"
 PROBLEM=$1
 public-setup
 . $PDIR/config
-locate-source
-compile
-TEST=$SAMPLE_TEST
-PTSFILE=$TDIR/points
-pstart "Checking on sample input: "
-test-run
-syntax-check
-pend "OK"
+
+function test-verdict
+{
+       pend "$2"
+       exit 0
+}
+
+if [ $TASK_TYPE == open-data ] ; then
+       [ -n "$2" ] || die "You need to specify test number for open data problems."
+       TEST=$2
+       pstart "Checking $TEST: "
+       open-locate
+       ln $SRCN $TDIR/$TEST.out
+       syntax-check
+       test-result 1 OK
+else
+       [ -z "$2" ] || die "Test number should be given only for open data problems."
+       locate-source
+       compile
+       for TEST in $SAMPLE_TESTS ; do
+               (
+               pstart "Checking on sample input $TEST: "
+               test-run
+               syntax-check
+               output-check
+               )
+       done
+fi