Skip to content

Commit

Permalink
Rollup merge of rust-lang#126081 - Kobzol:run-make-relative-paths, r=…
Browse files Browse the repository at this point in the history
…jieyouxu

Do not use relative paths to Rust source root in run-make tests

Pre-requisite for rust-lang#126080.

Fixes: rust-lang#126071

r? `@jieyouxu`
  • Loading branch information
workingjubilee authored Jun 6, 2024
2 parents 30bb51f + 6e1121b commit af229f5
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ pub fn python_command() -> Command {

pub fn htmldocck() -> Command {
let mut python = python_command();
python.arg(source_path().join("src/etc/htmldocck.py"));
python.arg(source_root().join("src/etc/htmldocck.py"));
python
}

pub fn source_path() -> PathBuf {
/// Path to the root rust-lang/rust source checkout.
pub fn source_root() -> 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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_root().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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_root().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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_root().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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/core/src/lib.rs")
.input(source_root().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, source_root, tmp_dir};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/core/src/lib.rs")
.input(source_root().join("library/core/src/lib.rs"))
.sysroot(tmp_dir().join("fakeroot"))
.cfg("no_global_oom_handling")
.run();
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use run_make_support::{htmldocck, rustc, rustdoc, source_path, tmp_dir};
use run_make_support::{htmldocck, rustc, rustdoc, source_root, tmp_dir};
use std::fs::read_dir;
use std::path::Path;

Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/rustdoc-themes/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Test that rustdoc will properly load in a theme file and display it in the theme selector.

use run_make_support::{htmldocck, rustdoc, source_path, tmp_dir};
use run_make_support::{htmldocck, rustdoc, source_root, tmp_dir};

fn main() {
let out_dir = tmp_dir().join("rustdoc-themes");
let test_css = out_dir.join("test.css");

let no_script =
std::fs::read_to_string(source_path().join("src/librustdoc/html/static/css/noscript.css"))
std::fs::read_to_string(source_root().join("src/librustdoc/html/static/css/noscript.css"))
.unwrap();

let mut test_content = String::new();
Expand Down

0 comments on commit af229f5

Please sign in to comment.