Skip to content

Commit

Permalink
Commit 7 : Add arg path
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-51 committed Mar 4, 2024
1 parent 979c9f4 commit 0a4502a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ impl RustcInvocationBuilder {
self
}

pub fn arg_path(&mut self, path: &[&str]) -> &mut RustcInvocationBuilder {
let path_buf = path.iter().collect::<PathBuf>();
self.cmd.arg(path_buf.to_str().unwrap());
self
}

#[track_caller]
pub fn run(&mut self) -> Output {
let caller_location = std::panic::Location::caller();
Expand Down
3 changes: 1 addition & 2 deletions tests/run-make/alloc-no-oom-handling/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ use run_make_support::rustc;
use std::path::PathBuf;

fn main() {
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
rustc()
.arg("--edition")
.arg("2021")
.arg("-Dwarnings")
.arg("--crate-type")
.arg("rlib")
.arg(lib_path.to_str().unwrap())
.arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"])
.arg("--cfg")
.arg("no_global_oom_handling")
.run();
Expand Down
3 changes: 1 addition & 2 deletions tests/run-make/alloc-no-rc/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ use run_make_support::rustc;
use std::path::PathBuf;

fn main() {
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
rustc()
.arg("--edition")
.arg("2021")
.arg("-Dwarnings")
.arg("--crate-type")
.arg("rlib")
.arg(lib_path.to_str().unwrap())
.arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"])
.arg("--cfg")
.arg("no_rc")
.run();
Expand Down
3 changes: 1 addition & 2 deletions tests/run-make/alloc-no-sync/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ use run_make_support::rustc;
use std::path::PathBuf;

fn main() {
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
rustc()
.arg("--edition")
.arg("2021")
.arg("-Dwarnings")
.arg("--crate-type")
.arg("rlib")
.arg(lib_path.to_str().unwrap())
.arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"])
.arg("--cfg")
.arg("no_sync")
.run();
Expand Down

0 comments on commit 0a4502a

Please sign in to comment.