mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Add test explorer
This commit is contained in:
parent
916914418a
commit
44be2432f5
19 changed files with 1083 additions and 172 deletions
|
@ -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 })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue