diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs index 820218732cecd..de2249ba0617c 100644 --- a/src/tools/run-make-support/src/lib.rs +++ b/src/tools/run-make-support/src/lib.rs @@ -45,6 +45,12 @@ impl RustcInvocationBuilder { self } + pub fn arg_path(&mut self, path: &[&str]) -> &mut RustcInvocationBuilder { + let path_buf = path.iter().collect::(); + self.cmd.arg(path_buf.to_str().unwrap()); + self + } + #[track_caller] pub fn run(&mut self) -> Output { let caller_location = std::panic::Location::caller(); diff --git a/tests/run-make/alloc-no-oom-handling/Makefile b/tests/run-make/alloc-no-oom-handling/Makefile deleted file mode 100644 index 87f74c69c7939..0000000000000 --- a/tests/run-make/alloc-no-oom-handling/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_global_oom_handling diff --git a/tests/run-make/alloc-no-oom-handling/rmake.rs b/tests/run-make/alloc-no-oom-handling/rmake.rs new file mode 100644 index 0000000000000..5a855b11f9e29 --- /dev/null +++ b/tests/run-make/alloc-no-oom-handling/rmake.rs @@ -0,0 +1,19 @@ +// ignore-tidy-linelength + +extern crate run_make_support; + +use run_make_support::rustc; +use std::path::PathBuf; + +fn main() { + rustc() + .arg("--edition") + .arg("2021") + .arg("-Dwarnings") + .arg("--crate-type") + .arg("rlib") + .arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"]) + .arg("--cfg") + .arg("no_global_oom_handling") + .run(); +} diff --git a/tests/run-make/alloc-no-rc/Makefile b/tests/run-make/alloc-no-rc/Makefile deleted file mode 100644 index 9824b17e6c2a7..0000000000000 --- a/tests/run-make/alloc-no-rc/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_rc diff --git a/tests/run-make/alloc-no-rc/rmake.rs b/tests/run-make/alloc-no-rc/rmake.rs new file mode 100644 index 0000000000000..c5217e22e05b6 --- /dev/null +++ b/tests/run-make/alloc-no-rc/rmake.rs @@ -0,0 +1,19 @@ +// ignore-tidy-linelength + +extern crate run_make_support; + +use run_make_support::rustc; +use std::path::PathBuf; + +fn main() { + rustc() + .arg("--edition") + .arg("2021") + .arg("-Dwarnings") + .arg("--crate-type") + .arg("rlib") + .arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"]) + .arg("--cfg") + .arg("no_rc") + .run(); +} diff --git a/tests/run-make/alloc-no-sync/Makefile b/tests/run-make/alloc-no-sync/Makefile deleted file mode 100644 index 04ec4c7d8bc9a..0000000000000 --- a/tests/run-make/alloc-no-sync/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_sync diff --git a/tests/run-make/alloc-no-sync/rmake.rs b/tests/run-make/alloc-no-sync/rmake.rs new file mode 100644 index 0000000000000..d9423620ce0d6 --- /dev/null +++ b/tests/run-make/alloc-no-sync/rmake.rs @@ -0,0 +1,19 @@ +// ignore-tidy-linelength + +extern crate run_make_support; + +use run_make_support::rustc; +use std::path::PathBuf; + +fn main() { + rustc() + .arg("--edition") + .arg("2021") + .arg("-Dwarnings") + .arg("--crate-type") + .arg("rlib") + .arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"]) + .arg("--cfg") + .arg("no_sync") + .run(); +}