+
+function test-verdict
+{
+ pend "$2"
+ if [ $1 == 0 ] ; then
+ exit 1
+ else
+ exit 0
+ fi
+}
+
+if [ $TASK_TYPE == open-data ] ; then
+ [ -n "$TEST" ] || die "You need to specify test number for open data problems."
+ pstart "Checking $TEST: "
+ test-config
+ open-locate "$SRCFILE"
+ try-ln "$SDIR/$SRCN" $TDIR/$TEST.out
+ syntax-check
+ test-result $POINTS_PER_TEST OK
+else
+ [ -z "$TEST" ] || die "Test number should be given only for open data problems."
+ locate-source "$SRCFILE"
+ compile
+ RC=0
+ for TEST in $SAMPLE_TESTS ; do
+ (
+ pstart "Checking on sample input $TEST: "
+ test-config
+ test-run
+ syntax-check
+ output-check
+ ) || RC=1
+ done
+ exit $RC
+fi