mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: 修复测试数据参数传递异常
This commit is contained in:
1 parent
a1c42af7a7
commit
2e8f3e42cd
3 files changed
+3
-4
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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`);
|
||||
|
||||
Reference in new issue
Block a user