From 0dda12c127848b8d54c4b21223f63eaf05fa9ac4 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Wed, 21 May 2008 15:06:07 +0200 Subject: [PATCH] Introduced TEST_EXEC_CMD. --- eval/eval.cf | 4 ++++ eval/libeval.sh | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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" -- 2.39.5