about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/run-make-support/src/rustc.rs7
-rw-r--r--src/tools/run-make-support/src/rustdoc.rs7
-rw-r--r--tests/run-make/doctests-runtool/rmake.rs2
-rw-r--r--tests/run-make/exit-code/rmake.rs2
-rw-r--r--tests/run-make/repr128-dwarf/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-determinism/rmake.rs23
-rw-r--r--tests/run-make/wasm-abi/rmake.rs2
7 files changed, 30 insertions, 15 deletions
diff --git a/src/tools/run-make-support/src/rustc.rs b/src/tools/run-make-support/src/rustc.rs
index dcd184ac5a4..de773d688ef 100644
--- a/src/tools/run-make-support/src/rustc.rs
+++ b/src/tools/run-make-support/src/rustc.rs
@@ -91,6 +91,13 @@ impl Rustc {
         self
     }
 
+    /// Specify path to the output file.
+    pub fn output<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
+        self.cmd.arg("-o");
+        self.cmd.arg(path.as_ref());
+        self
+    }
+
     /// This flag defers LTO optimizations to the linker.
     pub fn linker_plugin_lto(&mut self, option: &str) -> &mut Self {
         self.cmd.arg(format!("-Clinker-plugin-lto={option}"));
diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-support/src/rustdoc.rs
index ba8668a3b4c..aa3c7dcf0e3 100644
--- a/src/tools/run-make-support/src/rustdoc.rs
+++ b/src/tools/run-make-support/src/rustdoc.rs
@@ -51,6 +51,13 @@ impl Rustdoc {
         self
     }
 
+    /// Specify path to the output folder.
+    pub fn output<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
+        self.cmd.arg("-o");
+        self.cmd.arg(path.as_ref());
+        self
+    }
+
     /// Specify output directory.
     pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
         self.cmd.arg("--out-dir").arg(path.as_ref());
diff --git a/tests/run-make/doctests-runtool/rmake.rs b/tests/run-make/doctests-runtool/rmake.rs
index 16451409528..6f89bf23b47 100644
--- a/tests/run-make/doctests-runtool/rmake.rs
+++ b/tests/run-make/doctests-runtool/rmake.rs
@@ -19,7 +19,7 @@ fn main() {
     let run_tool_binary = run_tool.join("runtool");
 
     rustc().input("t.rs").crate_type("rlib").run();
-    rustc().input("runtool.rs").arg("-o").arg(&run_tool_binary).run();
+    rustc().input("runtool.rs").output(&run_tool_binary).run();
 
     rustdoc()
         .input(current_dir().unwrap().join("t.rs"))
diff --git a/tests/run-make/exit-code/rmake.rs b/tests/run-make/exit-code/rmake.rs
index b1143153d0a..76d7777581b 100644
--- a/tests/run-make/exit-code/rmake.rs
+++ b/tests/run-make/exit-code/rmake.rs
@@ -15,7 +15,7 @@ fn main() {
         .arg("compile-error.rs")
         .run_fail_assert_exit_code(101);
 
-    rustdoc().arg("success.rs").arg("-o").arg(tmp_dir().join("exit-code")).run();
+    rustdoc().arg("success.rs").output(tmp_dir().join("exit-code")).run();
 
     rustdoc().arg("--invalid-arg-foo").run_fail_assert_exit_code(1);
 
diff --git a/tests/run-make/repr128-dwarf/rmake.rs b/tests/run-make/repr128-dwarf/rmake.rs
index d734b2add79..fd5dd810444 100644
--- a/tests/run-make/repr128-dwarf/rmake.rs
+++ b/tests/run-make/repr128-dwarf/rmake.rs
@@ -10,7 +10,7 @@ use std::rc::Rc;
 
 fn main() {
     let output = tmp_dir().join("repr128");
-    rustc().input("main.rs").arg("-o").arg(&output).arg("-Cdebuginfo=2").run();
+    rustc().input("main.rs").output(&output).arg("-Cdebuginfo=2").run();
     // Mach-O uses packed debug info
     let dsym_location = output
         .with_extension("dSYM")
diff --git a/tests/run-make/rustdoc-determinism/rmake.rs b/tests/run-make/rustdoc-determinism/rmake.rs
index 38ae75199fd..09097d4507d 100644
--- a/tests/run-make/rustdoc-determinism/rmake.rs
+++ b/tests/run-make/rustdoc-determinism/rmake.rs
@@ -1,18 +1,19 @@
-use run_make_support::{diff, rustc, rustdoc, tmp_dir};
+// Assert that the search index is generated deterministically, regardless of the
+// order that crates are documented in.
+
+use run_make_support::{diff, rustdoc, tmp_dir};
 
-/// Assert that the search index is generated deterministically, regardless of the
-/// order that crates are documented in.
 fn main() {
-    let dir_first = tmp_dir().join("first");
-    rustdoc().out_dir(&dir_first).input("foo.rs").run();
-    rustdoc().out_dir(&dir_first).input("bar.rs").run();
+    let foo_first = tmp_dir().join("foo_first");
+    rustdoc().input("foo.rs").output(&foo_first).run();
+    rustdoc().input("bar.rs").output(&foo_first).run();
 
-    let dir_second = tmp_dir().join("second");
-    rustdoc().out_dir(&dir_second).input("bar.rs").run();
-    rustdoc().out_dir(&dir_second).input("foo.rs").run();
+    let bar_first = tmp_dir().join("bar_first");
+    rustdoc().input("bar.rs").output(&bar_first).run();
+    rustdoc().input("foo.rs").output(&bar_first).run();
 
     diff()
-        .expected_file(dir_first.join("search-index.js"))
-        .actual_file(dir_second.join("search-index.js"))
+        .expected_file(foo_first.join("search-index.js"))
+        .actual_file(bar_first.join("search-index.js"))
         .run();
 }
diff --git a/tests/run-make/wasm-abi/rmake.rs b/tests/run-make/wasm-abi/rmake.rs
index 01f2b274423..a2dcafbbe0f 100644
--- a/tests/run-make/wasm-abi/rmake.rs
+++ b/tests/run-make/wasm-abi/rmake.rs
@@ -25,7 +25,7 @@ fn run(file: &Path, method: &str, expected_output: &str) {
         .arg("--invoke")
         .arg(method)
         .arg(file)
-        .command_output()
+        .output()
         .unwrap();
     assert!(output.status.success());
     assert_eq!(expected_output, String::from_utf8_lossy(&output.stdout));