;;
stdio) echo "Input file: <stdin> (from $PDIR/$TEST.in)"
ln $PDIR/$TEST.in $TDIR/$TEST.in
- cp $PDIR/$TEST.in $BOXDIR/$PROBLEM.in
- BOX_EXTRAS="$BOX_EXTRAS -i$PROBLEM.in"
+ BOX_EXTRAS="$BOX_EXTRAS -i$TDIR/$TEST.in"
;;
none) echo "Input file: <none>"
;;
BOX_EXTRAS="$BOX_EXTRAS -o/dev/null"
;;
stdio) echo "Output file: <stdout>"
- BOX_EXTRAS="$BOX_EXTRAS -o$PROBLEM.out"
+ BOX_EXTRAS="$BOX_EXTRAS -o$TDIR/$TEST.out"
;;
none) echo "Output file: <none>"
;;
file) [ -f $BOXDIR/$PROBLEM.out ] || test-result 0 "No output file."
cp $BOXDIR/$PROBLEM.out $TDIR/$TEST.out
;;
- stdio) [ -f $BOXDIR/$PROBLEM.out ] || test-result 0 "No output file."
- cp $BOXDIR/$PROBLEM.out $TDIR/$TEST.out
+ stdio) [ -f $TDIR/$TEST.out ] || test-result 0 "No output file."
;;
esac
}
BOXOPTS="`eval echo $TEST_SANDBOX_OPTS`$BOX_EXTRAS"
echo "Sandbox options: $BOXOPTS"
if ! $BOXCMD $BOXOPTS -- ./$PROBLEM 2>$TMPDIR/exec.out ; then
- MSG=`head -1 $TMPDIR/exec.out`
+ cat $TMPDIR/exec.out
+ MSG=`tail -1 $TMPDIR/exec.out`
test-result 0 "$MSG"
fi
cat $TMPDIR/exec.out
ICCMD=`eval echo $IA_CHECK`
echo "Interactive checker: $ICCMD"
if ! $HDIR/bin/iwrapper $BOXCMD $BOXOPTS -- ./$PROBLEM @@ $ICCMD 2>$TMPDIR/exec.out ; then
- MSG="`head -1 $TMPDIR/exec.out`"
+ cat $TMPDIR/exec.out
+ MSG="`tail -1 $TMPDIR/exec.out`"
test-result 0 "$MSG"
fi
cat $TMPDIR/exec.out
SCHECK=`eval echo $SYNTAX_CHECK`
echo "Syntax check command: $SCHECK"
if ! eval $SCHECK 2>$TMPDIR/exec.out ; then
- MSG=`head -1 $TMPDIR/exec.out`
+ cat $TMPDIR/exec.out
+ MSG=`tail -1 $TMPDIR/exec.out`
if [ -z "$MSG" ] ; then MSG="Wrong syntax." ; fi
test-result 0 "$MSG"
fi
OCHECK=`eval echo $OUTPUT_CHECK`
echo "Output check command: $OCHECK"
if ! eval $OCHECK 2>$TMPDIR/exec.out ; then
- MSG=`head -1 $TMPDIR/exec.out`
+ cat $TMPDIR/exec.out
+ MSG=`tail -1 $TMPDIR/exec.out`
if [ -z "$MSG" ] ; then MSG="Wrong answer." ; fi
test-result 0 "$MSG"
fi
- MSG=`head -1 $TMPDIR/exec.out`
+ cat $TMPDIR/exec.out
+ MSG=`tail -1 $TMPDIR/exec.out`
if [ -z "$MSG" ] ; then MSG="OK" ; fi
test-result $POINTS_PER_TEST "$MSG"
}