]> mj.ucw.cz Git - moe.git/commitdiff
Introduced TEST_EXEC_CMD.
authorTomas Gavenciak <gavento@atrey.karlin.mff.cuni.cz>
Wed, 21 May 2008 13:06:07 +0000 (15:06 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 21 May 2008 13:06:07 +0000 (15:06 +0200)
eval/eval.cf
eval/libeval.sh

index bb3b70134c8ec5b8ffa62a1a1b603d356f59192f..da30f81762148bffc6908df06eba0e2fa14b5ec7 100644 (file)
@@ -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
index bbf5a8fdb1f2da20027bd02f78268da24c525cad..1e59e512ea6cf8b36268f9e0fcc861eb832e6152 100644 (file)
@@ -382,7 +382,10 @@ function test-run-file
        pcont "<run> "
        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"