Skip to content

Commit 5b22425

Browse files
authored
Rollup merge of rust-lang#136630 - jieyouxu:render_tests, r=ChrisDenton
Change two std process tests to not output to std{out,err}, and fix test suite stat reset in bootstrap CI test rendering I don't really know how to test if this unbreaks CI (since rust-lang#136607 reported that this breaks the CI test rendering *sometimes*). Fixes rust-lang#136607. r? `@ChrisDenton` (two Windows process tests, but feel free to reroll)
2 parents c9635e5 + 9c5f025 commit 5b22425

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

library/std/src/process/tests.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,13 @@ fn test_creation_flags() {
418418
const EXIT_PROCESS_DEBUG_EVENT: u32 = 5;
419419
const DBG_EXCEPTION_NOT_HANDLED: u32 = 0x80010001;
420420

421-
let mut child =
422-
Command::new("cmd").creation_flags(DEBUG_PROCESS).stdin(Stdio::piped()).spawn().unwrap();
421+
let mut child = Command::new("cmd")
422+
.creation_flags(DEBUG_PROCESS)
423+
.stdin(Stdio::piped())
424+
.stdout(Stdio::null())
425+
.stderr(Stdio::null())
426+
.spawn()
427+
.unwrap();
423428
child.stdin.take().unwrap().write_all(b"exit\r\n").unwrap();
424429
let mut events = 0;
425430
let mut event = DEBUG_EVENT { event_code: 0, process_id: 0, thread_id: 0, _junk: [0; 164] };
@@ -486,9 +491,13 @@ fn test_proc_thread_attributes() {
486491
}
487492
}
488493

489-
let parent = ProcessDropGuard(Command::new("cmd").spawn().unwrap());
494+
let mut parent = Command::new("cmd");
495+
parent.stdout(Stdio::null()).stderr(Stdio::null());
496+
497+
let parent = ProcessDropGuard(parent.spawn().unwrap());
490498

491499
let mut child_cmd = Command::new("cmd");
500+
child_cmd.stdout(Stdio::null()).stderr(Stdio::null());
492501

493502
let parent_process_handle = parent.0.as_raw_handle();
494503

src/bootstrap/src/utils/render_tests.rs

+3
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ impl<'a> Renderer<'a> {
310310
match message {
311311
Message::Suite(SuiteMessage::Started { test_count }) => {
312312
println!("\nrunning {test_count} tests");
313+
self.benches = vec![];
314+
self.failures = vec![];
315+
self.ignored_tests = 0;
313316
self.executed_tests = 0;
314317
self.terse_tests_in_line = 0;
315318
self.tests_count = Some(test_count);

0 commit comments

Comments
 (0)