judge: 修复测试数据参数传递异常

This commit is contained in:
undefined committed 2020-11-08 02:32:17 +08:00
1 parent a1c42af7a7
commit 2e8f3e42cd
3 files changed
+3 -4

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.1.19",
"version": "2.1.20",
"main": "package.json",
"author": "masnn",
"repository": "https://github.com/hydro-dev/Hydro.git",
+1 -2
View File
@@ -204,7 +204,6 @@ export async function readYamlCases(folder: string, cfg: Dictionary<any> = {}, a
const next = args.next;
const checkFile = ensureFile(folder);
config.checker_type = cfg.checker_type || 'default';
if (cfg.filename) config.filename = cfg.filename;
if (cfg.checker) config.checker = checkFile(cfg.checker, '找不到比较器 ');
if (cfg.judge_extra_files) {
if (typeof cfg.judge_extra_files === 'string') {
@@ -301,7 +300,7 @@ export default async function readCases(folder: string, cfg: Record<string, any>
config = { ...yaml.safeLoad(fs.readFileSync(yamlConfig).toString()) as object, ...cfg };
} else if (fs.existsSync(iniConfig)) {
config = { ...convertIniConfig(fs.readFileSync(iniConfig).toString()), ...cfg };
}
} else config = cfg;
const result = await readYamlCases(folder, config, args);
isValidConfig(result);
return result;
+1 -1
View File
@@ -20,7 +20,7 @@ function judgeCase(c) {
return async (ctx, ctxSubtask) => {
const { filename } = ctx.config;
const { copyIn } = ctx.execute;
if (ctx.config.filename) copyIn[`${filename}.in`] = { src: c.input };
if (filename) copyIn[`${filename}.in`] = { src: c.input };
const copyOut = filename ? [`${filename}.out`] : [];
const stdin = filename ? null : c.input;
const stdout = path.resolve(ctx.tmpdir, `${c.id}.out`);