Skip to content

Commit 868ef64

Browse files
committed
migrate render test to new bootstrap command streaming API's
1 parent d5d9d1e commit 868ef64

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/bootstrap/src/utils/render_tests.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! to reimplement all the rendering logic in this module because of that.
88
99
use std::io::{BufRead, BufReader, Read, Write};
10-
use std::process::{ChildStdout, Stdio};
10+
use std::process::ChildStdout;
1111
use std::time::Duration;
1212

1313
use termcolor::{Color, ColorSpec, WriteColor};
@@ -52,23 +52,20 @@ pub(crate) fn try_run_tests(
5252
}
5353

5454
fn run_tests(builder: &Builder<'_>, cmd: &mut BootstrapCommand, stream: bool) -> bool {
55-
let cmd = cmd.as_command_mut();
56-
cmd.stdout(Stdio::piped());
57-
5855
builder.verbose(|| println!("running: {cmd:?}"));
5956

60-
let mut process = cmd.spawn().unwrap();
57+
let mut streaming_command = cmd.stream_capture_stdout(&builder.config.exec_ctx).unwrap();
6158

6259
// This runs until the stdout of the child is closed, which means the child exited. We don't
6360
// 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);
6562
if stream {
6663
renderer.stream_all();
6764
} else {
6865
renderer.render_all();
6966
}
7067

71-
let result = process.wait_with_output().unwrap();
68+
let result = streaming_command.wait_with_output().unwrap();
7269
if !result.status.success() && builder.is_verbose() {
7370
println!(
7471
"\n\ncommand did not execute successfully: {cmd:?}\n\

0 commit comments

Comments
 (0)