]> mj.ucw.cz Git - moe.git/blobdiff - eval/libeval.sh
Doc: Note that Isolate has moved
[moe.git] / eval / libeval.sh
index 1e59e512ea6cf8b36268f9e0fcc861eb832e6152..676dbef399f3b6ea2ddd5df1029ef95c747b694c 100644 (file)
@@ -263,14 +263,14 @@ function test-result
        SG=${M#Caught fatal signal }
        SG=${SG#Committed suicide by signal }
        if [ "$SG" != "$M" ] ; then
-               SG=`perl -MConfig -e '@s=split / /,$Config{sig_name}; print $s[$ARGV[0]]' $SG`
+               SG=`kill -l $SG 2>/dev/null` || SG=
                [ -z "$SG" ] || M="$M (SIG$SG)"
        fi
 
        # Translate runtime errors to readable strings
        RE=${M#Exited with error status }
        if [ -n "$EXIT_CODE_HOOK" -a "$RE" != "$M" ] ; then
-               NEWMSG=`$EXIT_CODE_HOOK $RE`
+               NEWMSG=`$EXIT_CODE_HOOK $RE` || NEWMSG=
                if [ -n "$NEWMSG" ] ; then
                        M="Runtime error $RE: $NEWMSG"
                fi
@@ -305,6 +305,15 @@ function test-prolog
                        ;;
                none)   echo "Input file: <none>"
                        ;;
+               dir)    echo "Input file: files in directory $PDIR/$TEST.in/"
+                       [ -d $PDIR/$TEST.in ] || die "Not a directory: $PDIR/$TEST.in"
+                       # TODO: recursive ln to $TDIR
+                       cp -r $PDIR/$TEST.in $TDIR/$TEST.in
+                       cp -r $PDIR/$TEST.in/* $BOXDIR/
+                       # Can have .stdin, but empty by default
+                       touch $BOXDIR/.stdin
+                       BOX_EXTRAS="$BOX_EXTRAS -i.stdin"
+                       ;;
                *)      die "Unknown IN_TYPE $IN_TYPE"
                        ;;
        esac
@@ -421,7 +430,7 @@ function test-run-interactive
 function test-run-open-data
 {
        [ -f $SDIR/$TEST.out ] || test-result 0 "No solution"
-       ln $SDIR/$TEST.out $TDIR/$TEST.out
+       try-ln $SDIR/$TEST.out $TDIR/$TEST.out
 }
 
 # Syntax checks
@@ -449,7 +458,7 @@ function output-check
        MSG=
        if [ -n "$OUTPUT_CHECK" -a "$OUT_TYPE" != none -a -z "$EV_NOCHECK" ] ; then
                pcont "<check> "
-               [ -f $PDIR/$TEST.out ] && ln $PDIR/$TEST.out $TDIR/$TEST.ok
+               [ -f $PDIR/$TEST.out ] && try-ln $PDIR/$TEST.out $TDIR/$TEST.ok
                OCHECK=$(expand-var OUTPUT_CHECK)
                echo "Output check command: $OCHECK"
                if ! eval $OCHECK 2>$TMPDIR/exec.out ; then