mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix testlib interactive
This commit is contained in:
1 parent
b548a48b23
commit
6db15b3556
2 files changed
+4
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.5.11",
|
"version": "2.5.12",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ function judgeCase(c) {
|
|||||||
return async (ctx, ctxSubtask) => {
|
return async (ctx, ctxSubtask) => {
|
||||||
ctx.executeInteractor.copyIn.in = c.input ? { src: c.input } : { content: '' };
|
ctx.executeInteractor.copyIn.in = c.input ? { src: c.input } : { content: '' };
|
||||||
ctx.executeInteractor.copyIn.out = c.output ? { src: c.output } : { content: '' };
|
ctx.executeInteractor.copyIn.out = c.output ? { src: c.output } : { content: '' };
|
||||||
ctx.executeInteractor.copyIn['testlib.h'] = { src: testlibSrc };
|
|
||||||
const [{ code, time_usage_ms, memory_usage_kb }, resInteractor] = await run([
|
const [{ code, time_usage_ms, memory_usage_kb }, resInteractor] = await run([
|
||||||
{
|
{
|
||||||
execute: ctx.executeUser.execute.replace(/\$\{name\}/g, 'code'),
|
execute: ctx.executeUser.execute.replace(/\$\{name\}/g, 'code'),
|
||||||
@@ -100,7 +99,9 @@ export const judge = async (ctx) => {
|
|||||||
return await compile(ctx.lang, ctx.code, 'code', copyIn, ctx.next);
|
return await compile(ctx.lang, ctx.code, 'code', copyIn, ctx.next);
|
||||||
})(),
|
})(),
|
||||||
(async () => {
|
(async () => {
|
||||||
const copyIn = {};
|
const copyIn = {
|
||||||
|
'testlib.h': testlibSrc,
|
||||||
|
};
|
||||||
for (const file of ctx.config.judge_extra_files) {
|
for (const file of ctx.config.judge_extra_files) {
|
||||||
copyIn[parseFilename(file)] = { src: file };
|
copyIn[parseFilename(file)] = { src: file };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user