Skip to content

Commit 19f913c

Browse files
committed
Auto merge of #138652 - ferrocene:pa-remote-test-rmake, r=<try>
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
2 parents b95aac6 + f5659f2 commit 19f913c

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/tools/run-make-support/src/run.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,20 @@ fn run_common(name: &str, args: Option<&[&str]>) -> Command {
1212
bin_path.push(cwd());
1313
bin_path.push(name);
1414
let ld_lib_path_envvar = env_var("LD_LIB_PATH_ENVVAR");
15-
let mut cmd = Command::new(bin_path);
15+
16+
let mut cmd = if let Some(rtc) = env::var_os("REMOTE_TEST_CLIENT") {
17+
let mut cmd = Command::new(rtc);
18+
cmd.arg("run");
19+
// FIXME: the "0" indicates how many support files should be uploaded along with the binary
20+
// to execute. If a test requires additional files to be pushed to the remote machine, this
21+
// will have to be changed (and the support files will have to be uploaded).
22+
cmd.arg("0");
23+
cmd.arg(bin_path);
24+
cmd
25+
} else {
26+
Command::new(bin_path)
27+
};
28+
1629
if let Some(args) = args {
1730
for arg in args {
1831
cmd.arg(arg);

tests/run-make/doctests-keep-binaries/rmake.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@ ignore-cross-compile attempts to run the doctests
2+
13
// Check that valid binaries are persisted by running them, regardless of whether the
24
// --run or --no-run option is used.
35

tests/run-make/target-cpu-native/rmake.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// warnings when used, and that binaries produced by it can also be successfully executed.
44
// See https://github.com/rust-lang/rust/pull/23238
55

6+
//@ ignore-cross-compile target-cpu=native doesn't work well when cross compiling
7+
68
use run_make_support::{run, rustc};
79

810
fn main() {

0 commit comments

Comments
 (0)