Skip to content

Commit c738f41

Browse files
committed
feat(cargo-codspeed): rethrow exit code
1 parent e40765d commit c738f41

File tree

1 file changed

+10
-3
lines changed
  • crates/cargo-codspeed/src

1 file changed

+10
-3
lines changed

crates/cargo-codspeed/src/run.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use codspeed::walltime::get_raw_result_dir_from_workspace_root;
1111
use glob::glob;
1212
use std::{
1313
io::{self, Write},
14+
os::unix::process::ExitStatusExt,
1415
path::{Path, PathBuf},
1516
};
1617

@@ -157,10 +158,16 @@ pub fn run_benches(
157158
if status.success() {
158159
Ok(())
159160
} else {
160-
Err(anyhow!(
161+
let code = status
162+
.code()
163+
.or(status.signal().map(|s| 128 + s))
164+
.unwrap_or(1);
165+
166+
eprintln!(
161167
"failed to execute the benchmark process, exit code: {}",
162-
status.code().unwrap_or(1)
163-
))
168+
code
169+
);
170+
std::process::exit(code);
164171
}
165172
})?;
166173
eprintln!("Done running {}", bench_name);

0 commit comments

Comments
 (0)