about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-05-14 09:55:30 -0400
committerGitHub <noreply@github.com>2024-05-14 09:55:30 -0400
commit31016d587936da143456bac5c9a89bcad8236bd3 (patch)
treefe30430c22cd1d8916533233dc11a84daaf545bb
parentd59f430eec01b9f94330eb287406eb522268b20e (diff)
parentf97d9151733ae29aa7d530a385003282b549dafc (diff)
downloadrust-31016d587936da143456bac5c9a89bcad8236bd3.tar.gz
rust-31016d587936da143456bac5c9a89bcad8236bd3.zip
Rollup merge of #125118 - GuillaumeGomez:cleanup-run-make, r=jieyouxu
Use new utility functions/methods in run-make tests

Little cleanup using new functions/methods I added into the `run-make-support` library.

r? `@jieyouxu`
-rw-r--r--tests/run-make/doctests-keep-binaries/rmake.rs9
-rw-r--r--tests/run-make/doctests-runtool/rmake.rs3
-rw-r--r--tests/run-make/rustdoc-map-file/rmake.rs6
3 files changed, 6 insertions, 12 deletions
diff --git a/tests/run-make/doctests-keep-binaries/rmake.rs b/tests/run-make/doctests-keep-binaries/rmake.rs
index ad0c2764df7..0613ef4839b 100644
--- a/tests/run-make/doctests-keep-binaries/rmake.rs
+++ b/tests/run-make/doctests-keep-binaries/rmake.rs
@@ -26,8 +26,7 @@ fn main() {
             .arg("--test")
             .arg("--persist-doctests")
             .arg(out_dir)
-            .arg("--extern")
-            .arg(format!("t={}", extern_path.display()))
+            .extern_("t", extern_path)
             .run();
         check_generated_binaries();
     });
@@ -38,8 +37,7 @@ fn main() {
             .arg("--test")
             .arg("--persist-doctests")
             .arg(out_dir)
-            .arg("--extern")
-            .arg(format!("t={}", extern_path.display()))
+            .extern_("t", extern_path)
             .arg("--no-run")
             .run();
         check_generated_binaries();
@@ -59,8 +57,7 @@ fn main() {
             .arg("doctests")
             .arg("--test-run-directory")
             .arg(run_dir)
-            .arg("--extern")
-            .arg("t=libt.rlib")
+            .extern_("t", "libt.rlib")
             .run();
 
         remove_dir_all(run_dir_path);
diff --git a/tests/run-make/doctests-runtool/rmake.rs b/tests/run-make/doctests-runtool/rmake.rs
index 6f89bf23b47..6cc7c6bbdaf 100644
--- a/tests/run-make/doctests-runtool/rmake.rs
+++ b/tests/run-make/doctests-runtool/rmake.rs
@@ -29,8 +29,7 @@ fn main() {
         .arg(run_dir_name)
         .arg("--runtool")
         .arg(&run_tool_binary)
-        .arg("--extern")
-        .arg("t=libt.rlib")
+        .extern_("t", "libt.rlib")
         .current_dir(tmp_dir())
         .run();
 
diff --git a/tests/run-make/rustdoc-map-file/rmake.rs b/tests/run-make/rustdoc-map-file/rmake.rs
index aaa7fea0b6b..d017b41bcdd 100644
--- a/tests/run-make/rustdoc-map-file/rmake.rs
+++ b/tests/run-make/rustdoc-map-file/rmake.rs
@@ -1,5 +1,4 @@
-use run_make_support::{rustdoc, tmp_dir};
-use std::process::Command;
+use run_make_support::{python_command, rustdoc, tmp_dir};
 
 fn main() {
     let out_dir = tmp_dir().join("out");
@@ -10,6 +9,5 @@ fn main() {
         .output(&out_dir)
         .run();
     // FIXME (GuillaumeGomez): Port the python script to Rust as well.
-    let python = std::env::var("PYTHON").unwrap_or("python".into());
-    assert!(Command::new(python).arg("validate_json.py").arg(&out_dir).status().unwrap().success());
+    assert!(python_command().arg("validate_json.py").arg(&out_dir).status().unwrap().success());
 }