]> mj.ucw.cz Git - eval.git/blobdiff - public/check
Submitting and checking of open data problems.
[eval.git] / public / check
index 37fce3035e7a64712aa3305c3ade81f341a42420..ea6512da50b354fe89879a728611e0392aa77d8d 100644 (file)
@@ -6,15 +6,27 @@ set -e
 . $MO_PUBLIC/bin/lib
 . $MO_PUBLIC/config
 
-[ -n "$1" ] || die "Usage: check <problem>"
+[ -n "$1" ] || die "Usage: check <problem> [<file>]"
 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"
+if [ -n "$OPEN_DATA_PROBLEM" ] ; then
+       [ -n "$2" ] || die "You need to specify test number for open data problems."
+       TEST=$2
+       open-locate
+       pstart "Checking $TEST: "
+       syntax-check
+       pend "OK"
+else
+       [ -z "$2" ] || die "No test number should be specified for normal problems."
+       locate-source
+       compile
+       for TEST in $SAMPLE_TESTS ; do
+               pstart "Checking on sample input $TEST: "
+               test-run
+               syntax-check
+               output-check
+               pend "OK"
+       done
+fi