mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
move valgrind configuration into Run builder
This commit is contained in:
parent
0e917be911
commit
4e6178ce55
2 changed files with 115 additions and 239 deletions
|
@ -141,6 +141,7 @@ pub struct Run {
|
|||
env: Vec<(String, String)>,
|
||||
stdin_vals: Vec<&'static str>,
|
||||
cwd: Option<OsString>,
|
||||
run_with_valgrind: bool,
|
||||
}
|
||||
|
||||
impl Run {
|
||||
|
@ -154,6 +155,7 @@ impl Run {
|
|||
stdin_vals: vec![],
|
||||
env: vec![],
|
||||
cwd: None,
|
||||
run_with_valgrind: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,6 +253,11 @@ impl Run {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn with_valigrind(mut self, use_valgrind: bool) -> Self {
|
||||
self.run_with_valgrind = use_valgrind;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn cwd<S>(mut self, arg: S) -> Self
|
||||
where
|
||||
S: Into<OsString>,
|
||||
|
@ -309,6 +316,10 @@ impl Run {
|
|||
}
|
||||
|
||||
pub fn run(self) -> Out {
|
||||
if self.run_with_valgrind {
|
||||
return self.run_with_valgrind();
|
||||
}
|
||||
|
||||
let command = self.command();
|
||||
self.run_with_command(command)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue