judge: fix testlib interactive

This commit is contained in:
undefined committed 2021-04-22 13:13:11 +08:00
1 parent b548a48b23
commit 6db15b3556
2 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.5.11",
"version": "2.5.12",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+3 -2
View File
@@ -20,7 +20,6 @@ function judgeCase(c) {
return async (ctx, ctxSubtask) => {
ctx.executeInteractor.copyIn.in = c.input ? { src: c.input } : { 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([
{
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);
})(),
(async () => {
const copyIn = {};
const copyIn = {
'testlib.h': testlibSrc,
};
for (const file of ctx.config.judge_extra_files) {
copyIn[parseFilename(file)] = { src: file };
}