Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 2bff511

Browse files
authored
Add stdio dumping to example (#2757)
* Add stdio dumping to example * Format
1 parent 5adaadd commit 2bff511

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/agent/coverage/examples/coverage.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct Args {
2222
#[arg(short, long)]
2323
source: bool,
2424

25+
#[arg(long)]
26+
dump_stdio: bool,
27+
2528
command: Vec<String>,
2629
}
2730

@@ -59,6 +62,23 @@ fn main() -> Result<()> {
5962
.timeout(timeout)
6063
.record()?;
6164

65+
if args.dump_stdio {
66+
if let Some(status) = &recorded.output.status {
67+
println!("status = {}", status);
68+
} else {
69+
println!("status = <unavailable>");
70+
}
71+
println!(
72+
"stderr ========================================================================="
73+
);
74+
println!("{}", recorded.output.stderr);
75+
println!(
76+
"stdout ========================================================================="
77+
);
78+
println!("{}", recorded.output.stdout);
79+
println!();
80+
}
81+
6282
if args.source {
6383
dump_source_line(&recorded.coverage)?;
6484
} else {

0 commit comments

Comments
 (0)