mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
judge: support fileIO on pretest (#840)
This commit is contained in:
1 parent
e3e69c7c7d
commit
0ad2a172d5
2 files changed
+3
-2
No files matched your search
@@ -18,6 +18,7 @@ export const judge = async (ctx: JudgeTask) => {
|
||||
// Allow 2x limits for better debugging
|
||||
time: parseTimeMS(ctx.config.time || '1s') * 2,
|
||||
memory: parseMemoryMB(ctx.config.memory || '128m'),
|
||||
filename: ctx.config.filename,
|
||||
addressSpaceLimit: address_space_limit,
|
||||
processLimit: process_limit,
|
||||
},
|
||||
|
||||
@@ -74,7 +74,7 @@ function parseArgs(execute: string): string[] {
|
||||
|
||||
function proc(params: Parameter): Cmd {
|
||||
const copyOut = supportOptional
|
||||
? params.copyOut
|
||||
? (params.copyOut || [])
|
||||
: (params.copyOut || []).map((i) => (i.endsWith('?') ? i.substring(0, i.length - 1) : i));
|
||||
const stdioLimit = parseMemoryMB(getConfig('stdio_size'));
|
||||
const stdioSize = params.cacheStdoutAndStderr ? stdioLimit : 4;
|
||||
@@ -82,7 +82,7 @@ function proc(params: Parameter): Cmd {
|
||||
if (params.cacheStdoutAndStderr) {
|
||||
copyOutCached.push('stdout', 'stderr');
|
||||
if (params.filename) copyOutCached.push(`${params.filename}.out?`);
|
||||
}
|
||||
} else if (params.filename) copyOut.push(`${params.filename}.out${supportOptional ? '?' : ''}`);
|
||||
const copyIn = { ...(params.copyIn || {}) };
|
||||
const stdin = params.stdin || { content: '' };
|
||||
if (params.filename) copyIn[`${params.filename}.in`] = stdin;
|
||||
|
||||
Reference in new issue
Block a user