Skip to content

Commit

Permalink
Merge #9
Browse files Browse the repository at this point in the history
9: Allow overriding valuer cwd r=MikailBag a=MikailBag



Co-authored-by: Mikail Bagishov <[email protected]>
  • Loading branch information
bors[bot] and MikailBag authored May 15, 2021
2 parents 3ec95ed + 1dd2855 commit f2eebed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit f2eebed

Please sign in to comment.