|
1 | 1 | #!/bin/sh
|
| 2 | +# To suppress false positive of FILELIMIT misspelling of TIMELIMIT: |
| 3 | +# shellcheck disable=SC2153 |
2 | 4 |
|
3 | 5 | # Script to test (run and compare) submissions with a single testcase
|
4 | 6 | #
|
|
7 | 9 | #
|
8 | 10 | # <testdata.in> File containing test-input with absolute pathname.
|
9 | 11 | # <testdata.out> File containing test-output with absolute pathname.
|
10 |
| -# <timelimit> Timelimit in seconds, optionally followed by ':' and |
11 |
| -# the hard limit to kill still running submissions. |
| 12 | +# <timelimit> Timelimit in seconds in the format |
| 13 | +# "<cpu_soft>:<cpu_hard>,<wall_soft>:<wall_hard>". |
12 | 14 | # <workdir> Directory where to execute submission in a chroot-ed
|
13 | 15 | # environment. For best security leave it as empty as possible.
|
14 | 16 | # Certainly do not place output-files there!
|
@@ -200,15 +202,15 @@ if [ $COMBINED_RUN_COMPARE -eq 1 ]; then
|
200 | 202 | fi
|
201 | 203 |
|
202 | 204 | exitcode=0
|
203 |
| -# To suppress false positive of FILELIMIT misspelling of TIMELIMIT: |
204 |
| -# shellcheck disable=SC2153 |
| 205 | +TIMELIMIT_CPU="${TIMELIMIT%%,*}" |
| 206 | +TIMELIMIT_WALL="${TIMELIMIT#*,}" |
205 | 207 | runcheck "$RUN_SCRIPT" $RUNARGS \
|
206 | 208 | $GAINROOT "$RUNGUARD" ${DEBUG:+-v -V "DEBUG=$DEBUG"} ${TMPDIR:+ -V "TMPDIR=$TMPDIR"} $CPUSET_OPT \
|
207 | 209 | -r "$PWD/../.." \
|
208 | 210 | --nproc=$PROCLIMIT \
|
209 | 211 | --no-core --streamsize=$FILELIMIT \
|
210 | 212 | --user="$RUNUSER" --group="$RUNGROUP" \
|
211 |
| - --walltime=$TIMELIMIT --cputime=$TIMELIMIT \ |
| 213 | + --walltime="$TIMELIMIT_WALL" --cputime="$TIMELIMIT_CPU" \ |
212 | 214 | --memsize=$MEMLIMIT --filesize=$FILELIMIT \
|
213 | 215 | --stderr=program.err --outmeta=program.meta -- \
|
214 | 216 | "$PREFIX/$PROGRAM" 2>runguard.err
|
|
0 commit comments