Skip to content

Commit 49980e9

Browse files
jieyouxugitbot
authored and
gitbot
committed
tests(std): don't output to std{out,err} in test_creation_flags and test_proc_thread_attributes
1 parent fecb7bd commit 49980e9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Diff for: 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

0 commit comments

Comments
 (0)