mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
judge: checker: testlib: catch errors
This commit is contained in:
1 parent
7461f261dc
commit
5ca9d7689f
1 file changed
+8
-1
@@ -188,7 +188,7 @@ const checkers: Record<string, Checker> = new Proxy({
|
||||
},
|
||||
|
||||
async testlib(config) {
|
||||
const { stderr, status } = await run(`${config.execute} /w/in /w/user_out /w/answer`, {
|
||||
const { stderr, status, code } = await run(`${config.execute} /w/in /w/user_out /w/answer`, {
|
||||
copyIn: {
|
||||
in: config.input,
|
||||
user_out: config.user_stdout,
|
||||
@@ -204,6 +204,13 @@ const checkers: Record<string, Checker> = new Proxy({
|
||||
message: stderr,
|
||||
};
|
||||
}
|
||||
if (status === STATUS.STATUS_RUNTIME_ERROR) {
|
||||
return {
|
||||
status: STATUS.STATUS_WRONG_ANSWER,
|
||||
score: 0,
|
||||
message: `Checker exited with code ${code}`,
|
||||
};
|
||||
}
|
||||
return parse(stderr, config.score);
|
||||
},
|
||||
}, {
|
||||
|
||||
Reference in new issue
Block a user