X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=bin%2Flib;h=6f5c4763a0420d00acf80e7ea2f6da50e45c8a20;hb=11186a847caaa8904ecd26f65d5fdc5bcdb2096a;hp=126e0fd2ee20e09b2119154ac02dda994a74e76e;hpb=e7d24c46c66aead08c0dde29cfbc6e0a58753793;p=eval.git diff --git a/bin/lib b/bin/lib index 126e0fd..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" @@ -241,6 +265,10 @@ function test-prolog *) die "Unknown IN_TYPE $IN_TYPE" ;; esac + if [ -n "$EV_PEDANT" -a $IN_TYPE != none ] ; then + pcont " " + bin/pedant <$TDIR/$TEST.in | tr '\n' ' ' >&2 + fi case $OUT_TYPE in file) echo "Output file: $PROBLEM.out" [ $TASK_TYPE == interactive ] || BOX_EXTRAS="$BOX_EXTRAS -o/dev/null" @@ -310,11 +338,20 @@ function test-run-interactive test-epilog } +# "Running" of open-data problems + +function test-run-open-data +{ + [ -f $SDIR/$TEST.out ] || test-result 0 "No solution." + ln $SDIR/$TEST.out $TDIR/$TEST.out +} + # Syntax checks function syntax-check { [ -n "$SYNTAX_CHECK" ] || return 0 + [ -z "$EV_NOCHECK" ] || return 0 pcont " " SCHECK=`eval echo $SYNTAX_CHECK` echo "Syntax check command: $SCHECK" @@ -332,7 +369,7 @@ function syntax-check function output-check { MSG= - if [ -n "$OUTPUT_CHECK" -a "$OUT_TYPE" != none ] ; then + if [ -n "$OUTPUT_CHECK" -a "$OUT_TYPE" != none -a -z "$EV_NOCHECK" ] ; then pcont " " [ -f $PDIR/$TEST.out ] && ln $PDIR/$TEST.out $TDIR/$TEST.ok OCHECK=`eval echo $OUTPUT_CHECK` @@ -368,8 +405,8 @@ function public-setup mkdir -p $BOXDIR rm -rf $BOXDIR/* BOXCMD="$MO_ROOT/bin/box -c$BOXDIR" - exec >log - pend "OK (see 'log' for details)" + exec >check-log + pend "OK (see 'check-log' for details)" } # Locate output of open data problem, test case TEST @@ -384,5 +421,5 @@ function open-locate else SRCN=$SDIR/$PROBLEM$TEST.out fi - [ -f $SRCN ] || fatal "Output file $SRCN not found" + [ -f "$SDIR/$SRCN" ] || fatal "Output file $SRCN not found" }