Skip to content

Commit 00ccc7a

Browse files
committed
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.
1 parent dee5024 commit 00ccc7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/run-pass/backtrace.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ fn runtest(me: &str) {
5353
"bad output: {}", s);
5454

5555
// Make sure the stack trace is *not* printed
56-
let p = template.clone().arg("fail").spawn().unwrap();
56+
// (Remove RUST_BACKTRACE from our own environment, in case developer
57+
// is running `make check` with it on.)
58+
let p = template.clone().arg("fail").env_remove("RUST_BACKTRACE").spawn().unwrap();
5759
let out = p.wait_with_output().unwrap();
5860
assert!(!out.status.success());
5961
let s = str::from_utf8(&out.error).unwrap();

0 commit comments

Comments
 (0)