P=`cat $TDIR/$TEST.pts`
rm $TDIR/$TEST.pts
fi
+
+ # Translate signal numbers to readable strings
+ 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`
+ [ -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"
box-clean
echo "Executable file: $TDIR/$PROBLEM"
if [ ! -x $TDIR/$PROBLEM ] ; then
- test-result 0 "Compile error."
+ test-result 0 "Compile error"
fi
cp $TDIR/$PROBLEM $BOXDIR/
BOX_EXTRAS=
echo "Sandbox contents after exit:"
ls -Al $BOXDIR
case ${OUT_TYPE:-$IO_TYPE} in
- file) [ -f $BOXDIR/$PROBLEM.out ] || test-result 0 "No output file."
+ file) [ -f $BOXDIR/$PROBLEM.out ] || test-result 0 "No output file"
cp $BOXDIR/$PROBLEM.out $TDIR/$TEST.out
;;
- stdio) [ -f $BOXDIR/.stdout ] || test-result 0 "No output file."
+ stdio) [ -f $BOXDIR/.stdout ] || test-result 0 "No output file"
cp $BOXDIR/.stdout $TDIR/$TEST.out
;;
esac
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
if ! eval $SCHECK 2>$TMPDIR/exec.out ; then
cat $TMPDIR/exec.out
MSG=`tail -1 $TMPDIR/exec.out`
- if [ -z "$MSG" ] ; then MSG="Wrong syntax." ; fi
+ if [ -z "$MSG" ] ; then MSG="Wrong syntax" ; fi
test-result 0 "$MSG"
fi
cat $TMPDIR/exec.out
if ! eval $OCHECK 2>$TMPDIR/exec.out ; then
cat $TMPDIR/exec.out
MSG=`tail -1 $TMPDIR/exec.out`
- if [ -z "$MSG" ] ; then MSG="Wrong answer." ; fi
+ if [ -z "$MSG" ] ; then MSG="Wrong answer" ; fi
test-result 0 "$MSG"
fi
cat $TMPDIR/exec.out