Skip to content

Commit 085efcf

Browse files
Switch to File::open() instead of spawning cat to avoid waiting on spawned process
1 parent 264f1e4 commit 085efcf

File tree

5 files changed

+2
-6
lines changed

5 files changed

+2
-6
lines changed

xtask/output_files/net.out

231 Bytes
Binary file not shown.

xtask/snapshot_elfs/hints_inner

-16 Bytes
Binary file not shown.

xtask/snapshot_elfs/net

994 KB
Binary file not shown.

xtask/snapshot_elfs/timestamp

8 Bytes
Binary file not shown.

xtask/src/print_snapshot.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,15 @@ pub fn test_single_print_snapshot(name: &str) -> anyhow::Result<()> {
3030
let frame_path = format!("xtask/output_files/{}.out", name);
3131
let elf_path = format!("xtask/snapshot_elfs/{}", name);
3232

33-
let frames = Command::new("cat")
34-
.arg(frame_path)
35-
.stdout(Stdio::piped())
36-
.spawn()
37-
.unwrap();
33+
let frames = std::fs::File::open(frame_path)?;
3834

3935
let actual = run_capturing_stdout(
4036
Command::new("defmt-print")
4137
.arg("-e")
4238
.arg(elf_path)
4339
.arg("--log-format")
4440
.arg("{L:4} {s}")
45-
.stdin(Stdio::from(frames.stdout.unwrap())),
41+
.stdin(Stdio::from(frames)),
4642
)
4743
.with_context(|| name.to_string())?;
4844

0 commit comments

Comments
 (0)