]> mj.ucw.cz Git - moe.git/blob - public/check
Sorting of tasks and parts is unnecessary, they have a well-defined order.
[moe.git] / public / check
1 # The Evaluator -- Public Checking Script
2 # (c) 2001--2004 Martin Mares <mj@ucw.cz>
3
4 set -e
5 [ -n "$MO_PUBLIC" -a -d "$MO_PUBLIC" ] || { echo >&2 "MO_PUBLIC not set, giving up." ; exit 1 ; }
6 . $MO_PUBLIC/bin/lib
7 . $MO_PUBLIC/config
8
9 [ -n "$1" ] || die "Usage: check <problem> [<test-number>]"
10 PROBLEM=$1
11 public-setup
12 . $PDIR/config
13
14 function test-verdict
15 {
16         pend "$2"
17         exit 0
18 }
19
20 if [ $TASK_TYPE == open-data ] ; then
21         [ -n "$2" ] || die "You need to specify test number for open data problems."
22         TEST=$2
23         pstart "Checking $TEST: "
24         open-locate
25         ln $SRCN $TDIR/$TEST.out
26         syntax-check
27         test-result 1 OK
28 else
29         [ -z "$2" ] || die "Test number should be given only for open data problems."
30         locate-source
31         compile
32         for TEST in $SAMPLE_TESTS ; do
33                 (
34                 pstart "Checking on sample input $TEST: "
35                 test-run
36                 syntax-check
37                 output-check
38                 )
39         done
40 fi