From: Tomas Gavenciak Date: Wed, 21 May 2008 13:06:07 +0000 (+0200) Subject: Introduced TEST_EXEC_CMD. X-Git-Tag: python-dummy-working~178 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0dda12c127848b8d54c4b21223f63eaf05fa9ac4;p=moe.git Introduced TEST_EXEC_CMD. --- diff --git a/eval/eval.cf b/eval/eval.cf index bb3b701..da30f81 100644 --- a/eval/eval.cf +++ b/eval/eval.cf @@ -48,6 +48,10 @@ POST_COMPILE_HOOK= PRE_RUN_HOOK= POST_RUN_HOOK= +# Command used to execute the compiled program, may be ./$PROGRAM (default) or an +# interpreter with $PROGRAM as a parameter. +TEST_EXEC_CMD= + ## Settings for individual languages # C diff --git a/eval/libeval.sh b/eval/libeval.sh index bbf5a8f..1e59e51 100644 --- a/eval/libeval.sh +++ b/eval/libeval.sh @@ -382,7 +382,10 @@ function test-run-file pcont " " BOXOPTS=$(expand-var TEST_SANDBOX_OPTS) echo "Sandbox options: $BOXOPTS" - if ! $BOXCMD $BOXOPTS -- ./$PROBLEM 2>$TMPDIR/exec.out ; then + EXECMD=$(expand-var TEST_EXEC_CMD) + [ -z "$EXECMD" ] || echo "Exec command: $EXECMD" + [ -z "$EXECMD" ] && EXECMD="./$PROBLEM" + if ! $BOXCMD $BOXOPTS -- $EXECMD 2>$TMPDIR/exec.out ; then cat $TMPDIR/exec.out MSG=`tail -1 $TMPDIR/exec.out` test-result 0 "$MSG" @@ -401,7 +404,10 @@ function test-run-interactive echo "Sandbox options: $BOXOPTS" ICCMD=$(expand-var IA_CHECK) echo "Interactive checker: $ICCMD" - if ! $HDIR/bin/iwrapper $BOXCMD $BOXOPTS -- ./$PROBLEM @@ $ICCMD 2>$TMPDIR/exec.out ; then + EXECMD=$(expand-var TEST_EXEC_CMD) + [ -z "$EXECMD" ] || echo "Exec command: $EXECMD" + [ -z "$EXECMD" ] && EXECMD="./$PROBLEM" + if ! $HDIR/bin/iwrapper $BOXCMD $BOXOPTS -- $EXECMD @@ $ICCMD 2>$TMPDIR/exec.out ; then cat $TMPDIR/exec.out MSG="`head -1 $TMPDIR/exec.out`" test-result 0 "$MSG"