]> mj.ucw.cz Git - moe.git/commitdiff
Check: return proper exit code.
authorMartin Mares <mj@ucw.cz>
Sun, 10 Jun 2007 16:14:36 +0000 (18:14 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 10 Jun 2007 16:14:36 +0000 (18:14 +0200)
public/check

index be2f99fc0479ac29ce63fe5420fd69cade4854f4..d5fecff46b3e1872cc429a1e8b70645286101693 100755 (executable)
@@ -1,3 +1,4 @@
+#!/bin/bash
 # The Evaluator -- Public Checking Script
 # (c) 2001--2004 Martin Mares <mj@ucw.cz>
 
@@ -14,7 +15,11 @@ public-setup
 function test-verdict
 {
        pend "$2"
-       exit 0
+       if [ $1 == 0 ] ; then
+               exit 1
+       else
+               exit 0
+       fi
 }
 
 if [ $TASK_TYPE == open-data ] ; then
@@ -29,12 +34,14 @@ else
        [ -z "$2" ] || die "Test number should be given only for open data problems."
        locate-source
        compile
+       RC=0
        for TEST in $SAMPLE_TESTS ; do
                (
                pstart "Checking on sample input $TEST: "
                test-run
                syntax-check
                output-check
-               )
+               ) || RC=1
        done
+       exit $RC
 fi