COMP_SANDBOX_OPTS=$(expand-var COMP_SANDBOX_OPTS)
echo "Compiler command: $CCMD"
echo "Compiler sandbox options: $COMP_SANDBOX_OPTS"
- eval $COMP_SANDBOX_INIT
+ if [ -n "$PRE_COMPILE_HOOK" ] ; then
+ echo "Pre-compile hook: $PRE_COMPILE_HOOK"
+ eval $PRE_COMPILE_HOOK
+ fi
echo "Compiler input files:"
ls -Al $BOXDIR
fi
cat $TDIR/compile.out
rm $TDIR/compile.out
+ if [ -n "$POST_COMPILE_HOOK ] ; then
+ echo "Post-compile hook: $POST_COMPILE_HOOK"
+ eval $POST_COMPILE_HOOK
+ fi
echo "Compiler output files:"
ls -Al $BOXDIR
if [ ! -f $BOXDIR/$PROBLEM ] ; then
esac
echo "Timeout: $TIME_LIMIT s"
echo "Memory: $MEM_LIMIT KB"
- eval $SANDBOX_INIT
+ if [ -n "$PRE_RUN_HOOK" ] ; then
+ echo "Pre-run hook: $PRE_RUN_HOOK"
+ eval $PRE_RUN_HOOK
+ fi
echo "Sandbox contents before start:"
ls -Al $BOXDIR
}
function test-epilog
{
+ if [ -n "$POST_RUN_HOOK" ] ; then
+ echo "Post-run hook: $POST_RUN_HOOK"
+ eval $POST_RUN_HOOK
+ fi
echo "Sandbox contents after exit:"
ls -Al $BOXDIR
case ${OUT_TYPE:-$IO_TYPE} in
# Sandbox options used when compiling
COMP_SANDBOX_OPTS='-m262144 -w60 -e -i/dev/null'
-# Sandbox initialization commands for compilation
-COMP_SANDBOX_INIT=
-
# Translation of runtime errors: a function, which receives the exit code as an argument and
# if it is recognized as a runtime error code, it prints its name to the standard output.
EXIT_CODE_HOOK=
+# Hooks which can alter the contents of the sandbox in $BOXDIR before/after compilation/running
+PRE_COMPILE_HOOK=
+POST_COMPILE_HOOK=
+PRE_RUN_HOOK=
+POST_RUN_HOOK=
+
## Settings for individual languages
# C
# Extra options to be overridden in task configuration
BOX_EXTRAS=
-# Sandbox initialization commands
-SANDBOX_INIT=
-
### Debugging and testing
# DEBUG: Let `ev' run sample tests, too.