X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bin%2Flib;h=cb5e2150d2f9402a35d424a1cc2ebf44563f9884;hb=27eeef5382c1b3693c6ab64391cac17de9dc0016;hp=c83367f5e2d4fc070b273450a9c9449c59a1616d;hpb=75711a4f6db68ba247c626328ab02600c1a09f61;p=eval.git diff --git a/bin/lib b/bin/lib index c83367f..cb5e215 100644 --- a/bin/lib +++ b/bin/lib @@ -202,7 +202,8 @@ function test-prolog ;; stdio) echo "Input file: (from $PDIR/$TEST.in)" ln $PDIR/$TEST.in $TDIR/$TEST.in - BOX_EXTRAS="$BOX_EXTRAS -i$TDIR/$TEST.in" + cp $PDIR/$TEST.in $BOXDIR/.stdin + BOX_EXTRAS="$BOX_EXTRAS -i.stdin" ;; none) echo "Input file: " ;; @@ -214,7 +215,7 @@ function test-prolog BOX_EXTRAS="$BOX_EXTRAS -o/dev/null" ;; stdio) echo "Output file: " - BOX_EXTRAS="$BOX_EXTRAS -o$TDIR/$TEST.out" + BOX_EXTRAS="$BOX_EXTRAS -o.stdout" ;; none) echo "Output file: " ;; @@ -236,7 +237,8 @@ function test-epilog file) [ -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." + stdio) [ -f $BOXDIR/.stdout ] || test-result 0 "No output file." + cp $BOXDIR/.stdout $TDIR/$TEST.out ;; esac } @@ -250,7 +252,8 @@ function test-run-file 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 @@ -268,7 +271,8 @@ function test-run-interactive 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 @@ -284,7 +288,8 @@ function syntax-check 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 @@ -301,11 +306,13 @@ function output-check 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" }