Add test explorer

This commit is contained in:
hkalbasi 2024-03-01 13:40:29 +03:30
parent 916914418a
commit 44be2432f5
19 changed files with 1083 additions and 172 deletions

View file

@ -15,6 +15,7 @@ pub fn streaming_output(
err: ChildStderr,
on_stdout_line: &mut dyn FnMut(&str),
on_stderr_line: &mut dyn FnMut(&str),
on_eof: &mut dyn FnMut(),
) -> io::Result<(Vec<u8>, Vec<u8>)> {
let mut stdout = Vec::new();
let mut stderr = Vec::new();
@ -44,6 +45,9 @@ pub fn streaming_output(
on_stderr_line(line);
}
}
if eof {
on_eof();
}
}
})?;
@ -63,6 +67,7 @@ pub fn spawn_with_streaming_output(
child.stderr.take().unwrap(),
on_stdout_line,
on_stderr_line,
&mut || (),
)?;
let status = child.wait()?;
Ok(Output { status, stdout, stderr })