Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding valuer cwd #9

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow overriding valuer cwd
  • Loading branch information
MikailBag committed May 15, 2021
commit 1dd285517e195e82817083ae1ab00bf99ffafaef
10 changes: 4 additions & 6 deletions engine/src/apis/compile/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,10 @@ impl<'a> ProblemBuilder<'a> {
let valuer = pom::ChildValuer {
exe: valuer_exe,
extra_args: Vec::new(),
};

let valuer_config = FileRef {
root: FileRefRoot::Problem,
path: "valuer-cfg".to_string(),
current_dir: Some(FileRef {
root: FileRefRoot::Problem,
path: "valuer-cfg".to_string(),
}),
};

let problem = pom::Problem {
Expand All @@ -471,7 +470,6 @@ impl<'a> ProblemBuilder<'a> {
checker_cmd,
valuer: pom::Valuer::Child(valuer),
tests,
valuer_config,
};
let manifest_path = format!("{}/manifest.json", self.out_dir.display());
let manifest_data =
Expand Down
3 changes: 2 additions & 1 deletion pom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ pub enum Valuer {
pub struct ChildValuer {
/// Valuer binary
pub exe: FileRef,
/// Current directory. Default is problem assets directory
pub current_dir: Option<FileRef>,
/// Extra arguments to pass to valuer
#[serde(default)]
pub extra_args: Vec<String>,
Expand All @@ -148,5 +150,4 @@ pub struct Problem {
pub checker_exe: FileRef,
pub checker_cmd: Vec<String>,
pub valuer: Valuer,
pub valuer_config: FileRef,
}
1 change: 1 addition & 0 deletions valuer-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl Default for JudgeLog {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProblemInfo {
pub tests: Vec<String>,
// TODO: valuer config
}

#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
Expand Down