diff --git a/tests/common/util.rs b/tests/common/util.rs index 43bf43986..7b7f970c4 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -311,6 +311,15 @@ impl UCommand { self.raw.args(args.as_ref()); Box::new(self) } + + pub fn env(&mut self, key: K, val: V) -> Box<&mut UCommand> where K: AsRef, V: AsRef { + if self.has_run { + panic!(ALREADY_RUN); + } + self.raw.env(key, val); + Box::new(self) + } + pub fn run(&mut self) -> CmdResult { self.has_run = true; log_info("run", &self.comm_string);