Skip to content

Commit

Permalink
Switch to File::open() instead of spawning cat to avoid waiting on sp…
Browse files Browse the repository at this point in the history
…awned process
  • Loading branch information
BenFordTytherington committed Jan 10, 2025
1 parent 264f1e4 commit 085efcf
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 6 deletions.
Binary file added xtask/output_files/net.out
Binary file not shown.
Binary file modified xtask/snapshot_elfs/hints_inner
Binary file not shown.
Binary file added xtask/snapshot_elfs/net
Binary file not shown.
Binary file modified xtask/snapshot_elfs/timestamp
Binary file not shown.
8 changes: 2 additions & 6 deletions xtask/src/print_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@ pub fn test_single_print_snapshot(name: &str) -> anyhow::Result<()> {
let frame_path = format!("xtask/output_files/{}.out", name);
let elf_path = format!("xtask/snapshot_elfs/{}", name);

let frames = Command::new("cat")
.arg(frame_path)
.stdout(Stdio::piped())
.spawn()
.unwrap();
let frames = std::fs::File::open(frame_path)?;

let actual = run_capturing_stdout(
Command::new("defmt-print")
.arg("-e")
.arg(elf_path)
.arg("--log-format")
.arg("{L:4} {s}")
.stdin(Stdio::from(frames.stdout.unwrap())),
.stdin(Stdio::from(frames)),
)
.with_context(|| name.to_string())?;

Expand Down

0 comments on commit 085efcf

Please sign in to comment.