about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTakayuki Maeda <takoyaki0316@gmail.com>2025-03-25 15:36:32 +0900
committerGitHub <noreply@github.com>2025-03-25 15:36:32 +0900
commit3101bfbd6e6aab2fb65a7775d0ee38a24e9b0206 (patch)
treeb81d8bade6b0a3465baf17eeff28f67c5f02cf32
parent922cc7555f64e761d71e439966042e5bd43a2a7f (diff)
parentf5659f28f8a426d16c2c6f7b0ab7461958b4f0a6 (diff)
downloadrust-3101bfbd6e6aab2fb65a7775d0ee38a24e9b0206.tar.gz
rust-3101bfbd6e6aab2fb65a7775d0ee38a24e9b0206.zip
Rollup merge of #138652 - ferrocene:pa-remote-test-rmake, r=jieyouxu
Reintroduce remote-test support in run-make tests

The old Makefile-based infrastructure included support for executing binaries with remote-test-client if configured, but that didn't get ported to run_make_support as part of the rmake migration.

This PR re-introduces back that support, with the same implementation (and limitations) of the original Makefile-based support.

[Old Makefile-based implementation of this](https://github.com/rust-lang/rust/blob/9b8accbeb6336fa24d02b2a8bcaecaf44fe2bb65/tests/run-make/tools.mk#L65-L74)

try-job: armhf-gnu
-rw-r--r--src/tools/run-make-support/src/run.rs15
-rw-r--r--tests/run-make/doctests-keep-binaries/rmake.rs2
-rw-r--r--tests/run-make/target-cpu-native/rmake.rs2
3 files changed, 18 insertions, 1 deletions
diff --git a/src/tools/run-make-support/src/run.rs b/src/tools/run-make-support/src/run.rs
index 7812863ccc2..60e711d3402 100644
--- a/src/tools/run-make-support/src/run.rs
+++ b/src/tools/run-make-support/src/run.rs
@@ -12,7 +12,20 @@ fn run_common(name: &str, args: Option<&[&str]>) -> Command {
     bin_path.push(cwd());
     bin_path.push(name);
     let ld_lib_path_envvar = env_var("LD_LIB_PATH_ENVVAR");
-    let mut cmd = Command::new(bin_path);
+
+    let mut cmd = if let Some(rtc) = env::var_os("REMOTE_TEST_CLIENT") {
+        let mut cmd = Command::new(rtc);
+        cmd.arg("run");
+        // FIXME: the "0" indicates how many support files should be uploaded along with the binary
+        // to execute. If a test requires additional files to be pushed to the remote machine, this
+        // will have to be changed (and the support files will have to be uploaded).
+        cmd.arg("0");
+        cmd.arg(bin_path);
+        cmd
+    } else {
+        Command::new(bin_path)
+    };
+
     if let Some(args) = args {
         for arg in args {
             cmd.arg(arg);
diff --git a/tests/run-make/doctests-keep-binaries/rmake.rs b/tests/run-make/doctests-keep-binaries/rmake.rs
index 246539bcf82..a05223994df 100644
--- a/tests/run-make/doctests-keep-binaries/rmake.rs
+++ b/tests/run-make/doctests-keep-binaries/rmake.rs
@@ -1,3 +1,5 @@
+//@ ignore-cross-compile attempts to run the doctests
+
 // Check that valid binaries are persisted by running them, regardless of whether the
 // --run or --no-run option is used.
 
diff --git a/tests/run-make/target-cpu-native/rmake.rs b/tests/run-make/target-cpu-native/rmake.rs
index fd5fb6193fe..7b7974f3097 100644
--- a/tests/run-make/target-cpu-native/rmake.rs
+++ b/tests/run-make/target-cpu-native/rmake.rs
@@ -3,6 +3,8 @@
 // warnings when used, and that binaries produced by it can also be successfully executed.
 // See https://github.com/rust-lang/rust/pull/23238
 
+//@ ignore-cross-compile target-cpu=native doesn't work well when cross compiling
+
 use run_make_support::{run, rustc};
 
 fn main() {