From 0f15be9057b3d24566aeb8704c61ad3b68b2d5ac Mon Sep 17 00:00:00 2001 From: Zztrans <53961131+Zztrans@users.noreply.github.com> Date: Thu, 4 Apr 2024 18:29:40 +0000 Subject: [PATCH] fix judge CE --- judger/README.md | 4 ++++ judger/src/option.rs | 2 +- judger/src/worker/mod.rs | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/judger/README.md b/judger/README.md index 83d4198..974ff3d 100644 --- a/judger/README.md +++ b/judger/README.md @@ -11,3 +11,7 @@ In cmd-line mode, by providing the necessary arguments, it can run the code in a ## How to use Run `cargo run --bin judger` to get help. + +A simple example is: + +`cargo run --bin judger judge --language cpp --problem-slug hello-world --src-path {}` \ No newline at end of file diff --git a/judger/src/option.rs b/judger/src/option.rs index 9231141..3eecb29 100644 --- a/judger/src/option.rs +++ b/judger/src/option.rs @@ -21,7 +21,7 @@ pub struct JudgerOpt { #[structopt(long, default_value = "oj-lab-problem-package")] pub problem_package_bucket: String, /// Where to store problem package - #[structopt(env = "PROBLEM_PACKAGE_PATH", default_value = "problem-package")] + #[structopt(env = "PROBLEM_PACKAGE_PATH", default_value = "judger/workdirs/development/problem-package")] pub problem_package_dir: PathBuf, } diff --git a/judger/src/worker/mod.rs b/judger/src/worker/mod.rs index 6a2e10c..93b597a 100644 --- a/judger/src/worker/mod.rs +++ b/judger/src/worker/mod.rs @@ -142,6 +142,9 @@ impl JudgeWorker { } Err(anyhow::anyhow!("Failed to new builder result: {:?}", e)) }); + if new_builder_result.is_err() { + return new_builder_result.unwrap_err() + } let builder = new_builder_result.expect("builder creater error"); log::debug!("Builder created: {:?}", builder); let mut results: Vec = vec![];