Skip to content

Commit

Permalink
Do not use relative paths to Rust source root in run-make tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Jun 6, 2024
1 parent 67caf52 commit 1584d1e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ pub fn htmldocck() -> Command {
python
}

/// Path to the root rust-lang/rust source checkout.
pub fn source_path() -> PathBuf {
env_var("S").into()
}
Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/alloc-no-oom-handling/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// when the unstable no_global_oom_handling feature is turned on.
// See https://github.com/rust-lang/rust/pull/84266

use run_make_support::rustc;
use run_make_support::{rustc, source_path};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_path().join("library/alloc/src/lib.rs"))
.cfg("no_global_oom_handling")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/alloc-no-rc/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// when the unstable no_rc feature is turned on.
// See https://github.com/rust-lang/rust/pull/84266

use run_make_support::rustc;
use run_make_support::{rustc, source_path};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_path().join("library/alloc/src/lib.rs"))
.cfg("no_rc")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/alloc-no-sync/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// when the unstable no_sync feature is turned on.
// See https://github.com/rust-lang/rust/pull/84266

use run_make_support::rustc;
use run_make_support::{rustc, source_path};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_path().join("library/alloc/src/lib.rs"))
.cfg("no_sync")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/core-no-fp-fmt-parse/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// This test checks that the core library of Rust can be compiled without enabling
// support for formatting and parsing floating-point numbers.

use run_make_support::rustc;
use run_make_support::{rustc, source_path};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/core/src/lib.rs")
.input(source_path().join("library/core/src/lib.rs"))
.cfg("no_fp_fmt_parse")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/core-no-oom-handling/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// when the no_global_oom_handling feature is turned on.
// See https://github.com/rust-lang/rust/pull/110649

use run_make_support::{rustc, tmp_dir};
use run_make_support::{rustc, tmp_dir, source_path};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/core/src/lib.rs")
.input(source_path().join("library/core/src/lib.rs"))
.sysroot(tmp_dir().join("fakeroot"))
.cfg("no_global_oom_handling")
.run();
Expand Down

0 comments on commit 1584d1e

Please sign in to comment.