Skip to content

Commit 5012d20

Browse files
committed
don't leak RUST_BACKTRACE into test process
If the tests were run with `RUST_BACKTRACE=1 make check` this test failed. If they were run without it it succeeded. We need to use `env_remove` instead of `env_clear` because the latter will never work on windows
1 parent 7bd87c1 commit 5012d20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/run-pass/multi-panic.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ fn main() {
1717

1818
panic!();
1919
} else {
20-
let test = std::process::Command::new(&args[0]).arg("run_test").output().unwrap();
20+
let test = std::process::Command::new(&args[0]).arg("run_test")
21+
.env_remove("RUST_BACKTRACE")
22+
.output()
23+
.unwrap();
2124
assert!(!test.status.success());
2225
let err = String::from_utf8_lossy(&test.stderr);
2326
let mut it = err.lines();

0 commit comments

Comments
 (0)