From: Martin Mares Date: Fri, 8 Jun 2001 15:32:04 +0000 (+0000) Subject: Extra flags separated for C and Pascal. X-Git-Tag: python-dummy-working~499 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c2fdbe3ce6542e06346b532fb3173b9e955f24fa;p=eval.git Extra flags separated for C and Pascal. Extra sandbox init commands. Set HDIR to make it point to the home directory of the evaluator. Minor bug fixes. Don't forget to remove exec.out. Support for open data problems. --- diff --git a/TODO b/TODO index 7187e09..23ddf95 100644 --- a/TODO +++ b/TODO @@ -1,17 +1,17 @@ Evaluator ~~~~~~~~~ -mo-install: don't copy private test data to public lepsi time limity zkopirovat *.ok i kdyz program spadne na run-time error -submit: do real test? - -giant: sample input? +konfigurovatelne vstupni a vystupni soubory +konfigurovatelny pristup k timerum a /proc/self/stat (pripadne /proc/self/fd) +better formatting of the score table +online ukazovani runtime a memory +score: alignment of table cells Environment ~~~~~~~~~~~ per-user tmp ? spousteni rhide z mc -shift+sipky v rhide rhide: debugging Pascal programs: variable names must be upper-cased Contest @@ -21,3 +21,9 @@ Prepare /home/mo/public//* for all problems # ./comp-kickout # ./comp-cleanup + +before competition +~~~~~~~~~~~~~~~~~~ +uninstall telnetd +clean /tmp + /var/tmp and check permissions +reset owners of com-day* and com-all to avoid quota problems diff --git a/bin/ev b/bin/ev index 4846c9f..ad44b49 100755 --- a/bin/ev +++ b/bin/ev @@ -11,6 +11,7 @@ fi . config # Set up environment: +# HDIR home dir of the evaluator # PDIR problem specific data # SDIR contestant's solution # TDIR test results diff --git a/bin/lib b/bin/lib index ccb0b9c..37461da 100644 --- a/bin/lib +++ b/bin/lib @@ -70,6 +70,7 @@ function box-clean function dir-init { pstart "Initializing... " + HDIR=. PDIR=problems/$PROBLEM SDIR=solutions/$CONTESTANT/$PROBLEM TDIR=testing/$CONTESTANT/$PROBLEM @@ -122,10 +123,11 @@ function compile SRC=$SRCN EXE=$PROBLEM CCMD=COMP_$SRCEXT - CCMD="`eval echo ${!CCMD}`" - COMP_SANDBOX_OPTS="`eval echo $COMP_SANDBOX_OPTS`" + CCMD=`eval echo ${!CCMD}` + COMP_SANDBOX_OPTS=`eval echo $COMP_SANDBOX_OPTS` echo "Compiler command: $CCMD" echo "Compiler sandbox options: $COMP_SANDBOX_OPTS" + eval $COMP_SANDBOX_INIT echo "Compiler input files:" ls -Al $BOXDIR @@ -169,18 +171,20 @@ function test-run-file echo "Input: $TDIR/$PROBLEM" ln $PDIR/$TEST.in $TDIR/$TEST.in cp $PDIR/$TEST.in $BOXDIR/$PROBLEM.in + eval $SANDBOX_INIT echo "Input files:" ls -Al $BOXDIR pcont " " echo "Timeout: $TIME_LIMIT s" echo "Memory: $MEM_LIMIT KB" - BOXOPTS="`eval echo $TEST_SANDBOX_OPTS`" + BOXOPTS=`eval echo $TEST_SANDBOX_OPTS` echo "Sandbox options: $BOXOPTS" if ! $BOXCMD $BOXOPTS -- ./$PROBLEM 2>$TDIR/exec.out ; then - TEST_MSG="`cat $TDIR/exec.out`" + TEST_MSG="`head -1 $TDIR/exec.out`" pend "$TEST_MSG" - echo "$TEST_MSG" + cat $TDIR/exec.out + rm $TDIR/exec.out echo >>$PTSFILE "0 $TEST_MSG" return 1 fi @@ -208,19 +212,22 @@ function test-run-interactive echo "Input: $TDIR/$PROBLEM" ln $PDIR/$TEST.in $TDIR/$TEST.in cp $PDIR/$TEST.in $BOXDIR/$PROBLEM.in + eval $SANDBOX_INIT echo "Input files:" ls -Al $BOXDIR pcont " " echo "Timeout: $TIME_LIMIT s" echo "Memory: $MEM_LIMIT KB" - BOXOPTS="`eval echo $TEST_SANDBOX_OPTS`" + BOXOPTS=`eval echo $TEST_SANDBOX_OPTS` echo "Sandbox options: $BOXOPTS" - ICCMD="`eval echo $IA_CHECK`" + ICCMD=`eval echo $IA_CHECK` echo "Interactive checker: $ICCMD" - if ! bin/iwrapper $BOXCMD $BOXOPTS -- ./$PROBLEM @@ $ICCMD 2>$TDIR/exec.out ; then - TEST_MSG="`cat $TDIR/exec.out`" + if ! $HDIR/bin/iwrapper $BOXCMD $BOXOPTS -- ./$PROBLEM @@ $ICCMD 2>$TDIR/exec.out ; then + TEST_MSG="`head -1 $TDIR/exec.out`" pend "$TEST_MSG" + cat $TDIR/exec.out + rm $TDIR/exec.out echo "$TEST_MSG" echo >>$PTSFILE "0 $TEST_MSG" return 1 @@ -235,9 +242,9 @@ function syntax-check { [ -n "$SYNTAX_CHECK" ] || return 0 pcont " " - SCHECK="`eval echo $SYNTAX_CHECK`" + SCHECK=`eval echo $SYNTAX_CHECK` echo "Syntax check command: $SCHECK" - $SCHECK && return 0 + eval $SCHECK && return 0 pend "Wrong syntax." echo "Wrong syntax." echo >>$PTSFILE "0 Wrong syntax." @@ -250,10 +257,10 @@ function output-check { [ -n "$OUTPUT_CHECK" ] || return 0 pcont " " - ln $PDIR/$TEST.out $TDIR/$TEST.ok - OCHECK="`eval echo $OUTPUT_CHECK`" + [ -f $PDIR/$TEST.out ] && ln $PDIR/$TEST.out $TDIR/$TEST.ok + OCHECK=`eval echo $OUTPUT_CHECK` echo "Output check command: $OCHECK" - $OCHECK && return 0 + eval $OCHECK && return 0 pend "Wrong answer." echo "Wrong answer." echo >>$PTSFILE "0 Wrong answer." @@ -264,6 +271,7 @@ function output-check function public-setup { + HDIR=$MO_PUBLIC PDIR=$MO_PUBLIC/problems/$PROBLEM SDIR=. TDIR=~/.test @@ -279,3 +287,12 @@ function public-setup exec >log pend "OK (see 'log' for details)" } + +# Locate output of open data problem, test case TEST + +function open-locate +{ + [ -f $PDIR/$TEST.in ] || die "Unknown test $TEST" + SRCN=$SDIR/$PROBLEM$TEST.out + [ -f $SRCN ] || die "Output file $SRCN not found" +} diff --git a/config b/config index 84bf889..91426a1 100644 --- a/config +++ b/config @@ -22,20 +22,27 @@ TASK_TYPE=file # Known source file extensions EXTENSIONS="c C cpp p pas" -# Extra compiler flags (null, but can be overriden) +# Extra compiler flags for C (null, but can be overriden) EXTRA_CFLAGS= +# Extra compiler flags for Pascal +EXTRA_PFLAGS= + # For each source extension, we must give compiler command COMP_c='/usr/bin/gcc -O2 -g -o $EXE $EXTRA_CFLAGS $SRC' COMP_C='/usr/bin/g++ -O2 -g -o $EXE $EXTRA_CFLAGS $SRC' COMP_cpp="$COMP_C" -COMP_p='/usr/bin/fpc -Ci -Cr -g -O2 -So -Sg -o$EXE $EXTRA_CFLAGS $SRC' +COMP_p='/usr/bin/fpc -Ci -Cr -g -O2 -So -Sg -o$EXE $EXTRA_PFLAGS $SRC' COMP_pas="$COMP_p" # Sandbox options used when compiling COMP_SANDBOX_OPTS='-m65536 -t60 -w -e' +# Sandbox initializaton commands for compilation +COMP_SANDBOX_INIT= + # Sandbox options used when testing TEST_SANDBOX_OPTS='-a2 -f -m$MEM_LIMIT -t$TIME_LIMIT' # -w for wall clock measuring # For stdio tasks append '-i$PROBLEM.in -o$PROBLEM.out' +SANDBOX_INIT=