Skip to content

Commit 1584d1e

Browse files
committed
Do not use relative paths to Rust source root in run-make tests
1 parent 67caf52 commit 1584d1e

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

src/tools/run-make-support/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub fn htmldocck() -> Command {
8787
python
8888
}
8989

90+
/// Path to the root rust-lang/rust source checkout.
9091
pub fn source_path() -> PathBuf {
9192
env_var("S").into()
9293
}

tests/run-make/alloc-no-oom-handling/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the unstable no_global_oom_handling feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/84266
44

5-
use run_make_support::rustc;
5+
use run_make_support::{rustc, source_path};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/alloc/src/lib.rs")
12+
.input(source_path().join("library/alloc/src/lib.rs"))
1313
.cfg("no_global_oom_handling")
1414
.run();
1515
}

tests/run-make/alloc-no-rc/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the unstable no_rc feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/84266
44

5-
use run_make_support::rustc;
5+
use run_make_support::{rustc, source_path};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/alloc/src/lib.rs")
12+
.input(source_path().join("library/alloc/src/lib.rs"))
1313
.cfg("no_rc")
1414
.run();
1515
}

tests/run-make/alloc-no-sync/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the unstable no_sync feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/84266
44

5-
use run_make_support::rustc;
5+
use run_make_support::{rustc, source_path};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/alloc/src/lib.rs")
12+
.input(source_path().join("library/alloc/src/lib.rs"))
1313
.cfg("no_sync")
1414
.run();
1515
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// This test checks that the core library of Rust can be compiled without enabling
22
// support for formatting and parsing floating-point numbers.
33

4-
use run_make_support::rustc;
4+
use run_make_support::{rustc, source_path};
55

66
fn main() {
77
rustc()
88
.edition("2021")
99
.arg("-Dwarnings")
1010
.crate_type("rlib")
11-
.input("../../../library/core/src/lib.rs")
11+
.input(source_path().join("library/core/src/lib.rs"))
1212
.cfg("no_fp_fmt_parse")
1313
.run();
1414
}

tests/run-make/core-no-oom-handling/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the no_global_oom_handling feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/110649
44

5-
use run_make_support::{rustc, tmp_dir};
5+
use run_make_support::{rustc, tmp_dir, source_path};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/core/src/lib.rs")
12+
.input(source_path().join("library/core/src/lib.rs"))
1313
.sysroot(tmp_dir().join("fakeroot"))
1414
.cfg("no_global_oom_handling")
1515
.run();

0 commit comments

Comments
 (0)