X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=bin%2Flib;h=6f5c4763a0420d00acf80e7ea2f6da50e45c8a20;hb=11186a847caaa8904ecd26f65d5fdc5bcdb2096a;hp=a186e1cd256e5c0c41c46967ebdf9690f3d18099;hpb=785567d13d74d89796cb251b1945fe9a0ab39220;p=eval.git diff --git a/bin/lib b/bin/lib index a186e1c..6f5c476 100644 --- a/bin/lib +++ b/bin/lib @@ -208,6 +208,30 @@ function test-result P=`cat $TDIR/$TEST.pts` rm $TDIR/$TEST.pts fi + + # Translate signal numbers to readable strings + SG=${M#Caught fatal signal } + if [ "$SG" != "$M" ] ; then + SG=`perl -MConfig -e '@s=split / /,$Config{sig_name}; print $s[$ARGV[0]]' $SG` + [ -z "$SG" ] || M="$M (SIG$SG)" + fi + + # Translate Free Pascal runtime errors to readable strings + RE=${M#Exited with error status } + if [ "$FREE_PASCAL_RTE" == 1 -a "$RE" != "$M" ] ; then + N="Runtime error $RE" + case "$RE" in + 200) M="$N: Division by zero" ;; + 201) M="$N: Range check error" ;; + 202) M="$N: Stack overflow" ;; + 203) M="$N: Heap overflow" ;; + 205) M="$N: Floating point overflow" ;; + 215) M="$N: Arithmetic overflow" ;; + 216) M="$N: Segmentation fault" ;; + ???) M="$N" ;; + esac + fi + echo "Verdict: $M" echo "Points: $P" test-verdict $P "$M"