Skip to content

Commit

Permalink
Auto merge of rust-lang#128639 - folkertdev:rmake-thumb-none-qemu, r=…
Browse files Browse the repository at this point in the history
…<try>

migrate `thumb-none-qemu` to rmake

tracking issue: rust-lang#121876

I think this one is actually simpler than rust-lang#128636, we invoke `cargo run` with the right target and see if the expected result appears.

r? `@jieyouxu`

try-job: armhf-gnu
try-job: dist-various-1
try-job: test-various
  • Loading branch information
bors committed Aug 6, 2024
2 parents 93ea767 + 54f40ce commit 7084c9b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ run-make/staticlib-dylib-linkage/Makefile
run-make/symbol-mangling-hashed/Makefile
run-make/sysroot-crates-are-unstable/Makefile
run-make/thumb-none-cortex-m/Makefile
run-make/thumb-none-qemu/Makefile
run-make/translation/Makefile
run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
27 changes: 0 additions & 27 deletions tests/run-make/thumb-none-qemu/Makefile

This file was deleted.

51 changes: 51 additions & 0 deletions tests/run-make/thumb-none-qemu/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//! How to run this
//! $ ./x.py clean
//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
//!
//! For supported targets, see `example/.cargo/config`

//@ only-thumb

use std::path::PathBuf;

use run_make_support::{cmd, env_var};

const CRATE: &str = "example";

fn main() {
std::env::set_current_dir(CRATE).unwrap();

let target = env_var("TARGET");
let bootstrap_cargo = env_var("BOOTSTRAP_CARGO");
let path = env_var("PATH");
let rustc = env_var("RUSTC");

let target_dir = PathBuf::from("target");
let manifest_path = PathBuf::from("Cargo.toml");

let debug = {
let mut cmd = cmd(&bootstrap_cargo);
cmd.args(&["run", "--target", &target])
.env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x")
.env("CARGO_TARGET_DIR", &target_dir)
.env("PATH", &path)
.env("RUSTC", &rustc);
cmd.run()
};

let stdout = debug.stdout_utf8();
assert!(stdout.contains("x = 42"), "stdout: {:?}", stdout);

let release = {
let mut cmd = cmd(&bootstrap_cargo);
cmd.args(&["run", "--release", "--target", &target])
.env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x")
.env("CARGO_TARGET_DIR", &target_dir)
.env("PATH", &path)
.env("RUSTC", &rustc);
cmd.run()
};

let stdout = release.stdout_utf8();
assert!(stdout.contains("x = 42"), "stdout: {:?}", stdout);
}
20 changes: 0 additions & 20 deletions tests/run-make/thumb-none-qemu/script.sh

This file was deleted.

0 comments on commit 7084c9b

Please sign in to comment.