Skip to content

Commit 63f818e

Browse files
committed
Auto merge of #5151 - flip1995:fix_run_pass_tests, r=flip1995
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
2 parents c066807 + c86c09b commit 63f818e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/cargo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lazy_static! {
66
pub static ref CARGO_TARGET_DIR: PathBuf = {
77
match env::var_os("CARGO_TARGET_DIR") {
88
Some(v) => v.into(),
9-
None => "target".into(),
9+
None => env::current_dir().unwrap().join("target"),
1010
}
1111
};
1212
pub static ref TARGET_LIB: PathBuf = {

0 commit comments

Comments
 (0)