Skip to content

Commit ca275d7

Browse files
committed
migrate render test to new bootstrap command streaming API's
1 parent 4a9a4d0 commit ca275d7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bootstrap/src/utils/render_tests.rs

Lines changed: 6 additions & 6 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,23 @@ 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());
55+
let cmd = cmd.do_not_cache();
5756

5857
builder.verbose(|| println!("running: {cmd:?}"));
5958

60-
let mut process = cmd.spawn().unwrap();
59+
let mut streaming_command =
60+
cmd.start_capture_stdout(&builder.config.exec_ctx).stream().unwrap();
6161

6262
// This runs until the stdout of the child is closed, which means the child exited. We don't
6363
// run this on another thread since the builder is not Sync.
64-
let renderer = Renderer::new(process.stdout.take().unwrap(), builder);
64+
let renderer = Renderer::new(streaming_command.stdout.take().unwrap(), builder);
6565
if stream {
6666
renderer.stream_all();
6767
} else {
6868
renderer.render_all();
6969
}
7070

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

0 commit comments

Comments
 (0)