mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Fix tests not working with a different CARGO_TARGET_DIR.
This commit is contained in:
parent
de4230293d
commit
0ac41f0051
@ -7,7 +7,7 @@
|
||||
use cargo_test_support::registry::{Dependency, Package};
|
||||
use cargo_test_support::ProjectBuilder;
|
||||
use cargo_test_support::{is_nightly, paths, project, rustc_host, Execs};
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
struct Setup {
|
||||
rustc_wrapper: PathBuf,
|
||||
@ -131,15 +131,7 @@ fn setup() -> Option<Setup> {
|
||||
fn enable_build_std(e: &mut Execs, setup: &Setup) {
|
||||
// First up, force Cargo to use our "mock sysroot" which mimics what
|
||||
// libstd looks like upstream.
|
||||
let root = paths::root();
|
||||
let root = root
|
||||
.parent() // chop off test name
|
||||
.unwrap()
|
||||
.parent() // chop off `citN`
|
||||
.unwrap()
|
||||
.parent() // chop off `target`
|
||||
.unwrap()
|
||||
.join("tests/testsuite/mock-std");
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/testsuite/mock-std");
|
||||
e.env("__CARGO_TESTS_ONLY_SRC_ROOT", &root);
|
||||
|
||||
e.masquerade_as_nightly_cargo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user