Skip to content

Commit

Permalink
don't leak RUST_BACKTRACE into test process
Browse files Browse the repository at this point in the history
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
  • Loading branch information
oli-obk committed Jan 29, 2016
1 parent 7bd87c1 commit 5012d20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/run-pass/multi-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ fn main() {

panic!();
} else {
let test = std::process::Command::new(&args[0]).arg("run_test").output().unwrap();
let test = std::process::Command::new(&args[0]).arg("run_test")
.env_remove("RUST_BACKTRACE")
.output()
.unwrap();
assert!(!test.status.success());
let err = String::from_utf8_lossy(&test.stderr);
let mut it = err.lines();
Expand Down

0 comments on commit 5012d20

Please sign in to comment.