summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/compiletest/src/runtest/run_make.rs4
-rw-r--r--src/tools/run-make-support/src/run.rs25
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/rmake.rs3
3 files changed, 30 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest/run_make.rs b/src/tools/compiletest/src/runtest/run_make.rs
index 029da1c1898..60e8e16e25e 100644
--- a/src/tools/compiletest/src/runtest/run_make.rs
+++ b/src/tools/compiletest/src/runtest/run_make.rs
@@ -221,6 +221,10 @@ impl TestCx<'_> {
             cmd.env("REMOTE_TEST_CLIENT", remote_test_client);
         }
 
+        if let Some(runner) = &self.config.runner {
+            cmd.env("RUNNER", runner);
+        }
+
         // We don't want RUSTFLAGS set from the outside to interfere with
         // compiler flags set in the test cases:
         cmd.env_remove("RUSTFLAGS");
diff --git a/src/tools/run-make-support/src/run.rs b/src/tools/run-make-support/src/run.rs
index 60e711d3402..b95f3a5cfe5 100644
--- a/src/tools/run-make-support/src/run.rs
+++ b/src/tools/run-make-support/src/run.rs
@@ -1,4 +1,4 @@
-use std::ffi::OsStr;
+use std::ffi::{OsStr, OsString};
 use std::path::PathBuf;
 use std::{env, panic};
 
@@ -22,6 +22,20 @@ fn run_common(name: &str, args: Option<&[&str]>) -> Command {
         cmd.arg("0");
         cmd.arg(bin_path);
         cmd
+    } else if let Ok(runner) = std::env::var("RUNNER") {
+        let mut args = split_maybe_args(&runner);
+
+        let prog = args.remove(0);
+        let mut cmd = Command::new(prog);
+
+        for arg in args {
+            cmd.arg(arg);
+        }
+
+        cmd.arg("--");
+        cmd.arg(bin_path);
+
+        cmd
     } else {
         Command::new(bin_path)
     };
@@ -92,3 +106,12 @@ pub fn cmd<S: AsRef<OsStr>>(program: S) -> Command {
     command.env("LC_ALL", "C"); // force english locale
     command
 }
+
+fn split_maybe_args(s: &str) -> Vec<OsString> {
+    // FIXME(132599): implement proper env var/shell argument splitting.
+    s.split(' ')
+        .filter_map(|s| {
+            if s.chars().all(|c| c.is_whitespace()) { None } else { Some(OsString::from(s)) }
+        })
+        .collect()
+}
diff --git a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs
index 63904bea622..426d65b7af3 100644
--- a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs
+++ b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs
@@ -3,7 +3,8 @@
 // prevent the creation of a functional binary.
 // See https://github.com/rust-lang/rust/pull/49878
 
-//@ ignore-cross-compile
+//@ needs-target-std
+//@ ignore-android: FIXME(#142855)
 
 use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};