Skip to content

Commit

Permalink
Auto merge of rust-lang#5151 - flip1995:fix_run_pass_tests, r=flip1995
Browse files Browse the repository at this point in the history
Fix run-pass tests when CARGO_TARGET_DIR is not set

r? @lzutao

I got

```
thread '[ui] ui/crashes/ice-1969.rs' panicked at 'failed to exec `"target/debug/test_build_base/crashes/ice-1969.stage-id"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/pkrones/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.4.0/src/runtest.rs:1350:25
```

on tests with `// run-pass` locally. The reason for this is, that I haven't set `CARGO_TARGET_DIR` and then `"target"` was used as the `CARGO_TARGET_DIR`. It seems, that `compiletest-rs` cannot deal with relative paths for `// run-pass` tests.

changelog: none
  • Loading branch information
bors committed Feb 10, 2020
2 parents c066807 + c86c09b commit 63f818e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/cargo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lazy_static! {
pub static ref CARGO_TARGET_DIR: PathBuf = {
match env::var_os("CARGO_TARGET_DIR") {
Some(v) => v.into(),
None => "target".into(),
None => env::current_dir().unwrap().join("target"),
}
};
pub static ref TARGET_LIB: PathBuf = {
Expand Down

0 comments on commit 63f818e

Please sign in to comment.