score: better formatting of the score table
interactive tasks: solve deadlocks?
interactive tasks: logging of messages
-STDIO TASKS!!!
guide: compile <file>, not only <task>
guide: status
;;
stdio) echo "Input file: <stdin> (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: <none>"
;;
BOX_EXTRAS="$BOX_EXTRAS -o/dev/null"
;;
stdio) echo "Output file: <stdout>"
- BOX_EXTRAS="$BOX_EXTRAS -o$TDIR/$TEST.out"
+ BOX_EXTRAS="$BOX_EXTRAS -o.stdout"
;;
none) echo "Output file: <none>"
;;
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
}
/*
* A Simple Testing Sandbox
*
- * (c) 2001 Martin Mares <mj@ucw.cz>
+ * (c) 2001--2004 Martin Mares <mj@ucw.cz>
*/
#define _LARGEFILE64_SOURCE
memcpy(args, argv, argc * sizeof(char *));
args[argc] = NULL;
+ if (set_cwd && chdir(set_cwd))
+ die("chdir: %m");
if (redir_stdin)
{
close(0);
if (open(redir_stdout, O_WRONLY | O_CREAT | O_TRUNC, 0666) != 1)
die("open(\"%s\"): %m", redir_stdout);
}
- if (set_cwd && chdir(set_cwd))
- die("chdir: %m");
dup2(1, 2);
setpgrp();
if (memory_limit)