|
7 | 7 | //! to reimplement all the rendering logic in this module because of that.
|
8 | 8 |
|
9 | 9 | use std::io::{BufRead, BufReader, Read, Write};
|
10 |
| -use std::process::{ChildStdout, Stdio}; |
| 10 | +use std::process::ChildStdout; |
11 | 11 | use std::time::Duration;
|
12 | 12 |
|
13 | 13 | use termcolor::{Color, ColorSpec, WriteColor};
|
@@ -52,23 +52,20 @@ pub(crate) fn try_run_tests(
|
52 | 52 | }
|
53 | 53 |
|
54 | 54 | fn run_tests(builder: &Builder<'_>, cmd: &mut BootstrapCommand, stream: bool) -> bool {
|
55 |
| - let cmd = cmd.as_command_mut(); |
56 |
| - cmd.stdout(Stdio::piped()); |
57 |
| - |
58 | 55 | builder.verbose(|| println!("running: {cmd:?}"));
|
59 | 56 |
|
60 |
| - let mut process = cmd.spawn().unwrap(); |
| 57 | + let mut streaming_command = cmd.stream_capture_stdout(&builder.config.exec_ctx).unwrap(); |
61 | 58 |
|
62 | 59 | // This runs until the stdout of the child is closed, which means the child exited. We don't
|
63 | 60 | // run this on another thread since the builder is not Sync.
|
64 |
| - let renderer = Renderer::new(process.stdout.take().unwrap(), builder); |
| 61 | + let renderer = Renderer::new(streaming_command.stdout.take().unwrap(), builder); |
65 | 62 | if stream {
|
66 | 63 | renderer.stream_all();
|
67 | 64 | } else {
|
68 | 65 | renderer.render_all();
|
69 | 66 | }
|
70 | 67 |
|
71 |
| - let result = process.wait_with_output().unwrap(); |
| 68 | + let result = streaming_command.wait_with_output().unwrap(); |
72 | 69 | if !result.status.success() && builder.is_verbose() {
|
73 | 70 | println!(
|
74 | 71 | "\n\ncommand did not execute successfully: {cmd:?}\n\
|
|
0 commit comments