Make test/run-pass/backtrace.rs
more robust about own host environment.
Namely, I have been annoyed in the past when I have done `RUST_BACKTRACE=1 make check` only to discover (again) that such a trick causes this test to fail, because it assumes that the `RUST_BACKTRACE` environment variable is not set. Fix #22870
This commit is contained in:
parent
1cc8b6ec66
commit
c6b66034d6
@ -53,7 +53,9 @@ fn runtest(me: &str) {
|
|||||||
"bad output: {}", s);
|
"bad output: {}", s);
|
||||||
|
|
||||||
// Make sure the stack trace is *not* printed
|
// Make sure the stack trace is *not* printed
|
||||||
let p = template.clone().arg("fail").spawn().unwrap();
|
// (Remove RUST_BACKTRACE from our own environment, in case developer
|
||||||
|
// is running `make check` with it on.)
|
||||||
|
let p = template.clone().arg("fail").env_remove("RUST_BACKTRACE").spawn().unwrap();
|
||||||
let out = p.wait_with_output().unwrap();
|
let out = p.wait_with_output().unwrap();
|
||||||
assert!(!out.status.success());
|
assert!(!out.status.success());
|
||||||
let s = str::from_utf8(&out.error).unwrap();
|
let s = str::from_utf8(&out.error).unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user