mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
fix(test): Ensure panics show test code, not lib
This commit is contained in:
parent
2b7e335946
commit
15e3412b2f
@ -908,6 +908,7 @@ impl Execs {
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn verify_checks_output(&self, stdout: &[u8], stderr: &[u8]) {
|
||||
if self.expect_exit_code.unwrap_or(0) != 0
|
||||
&& self.expect_stdout.is_none()
|
||||
@ -934,6 +935,7 @@ impl Execs {
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn match_process(&self, process: &ProcessBuilder) -> Result<RawOutput> {
|
||||
println!("running {}", process);
|
||||
let res = if self.stream_output {
|
||||
@ -984,6 +986,7 @@ impl Execs {
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn match_output(&self, code: Option<i32>, stdout: &[u8], stderr: &[u8]) -> Result<()> {
|
||||
self.verify_checks_output(stdout, stderr);
|
||||
let stdout = std::str::from_utf8(stdout).expect("stdout is not utf8");
|
||||
|
Loading…
x
Reference in New Issue
Block a user