Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 54f40ce

Browse files
committedAug 4, 2024
migrate thumb-none-qemu to rmake
1 parent a886938 commit 54f40ce

File tree

4 files changed

+51
-48
lines changed

4 files changed

+51
-48
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,5 @@ run-make/staticlib-dylib-linkage/Makefile
5151
run-make/symbol-mangling-hashed/Makefile
5252
run-make/sysroot-crates-are-unstable/Makefile
5353
run-make/thumb-none-cortex-m/Makefile
54-
run-make/thumb-none-qemu/Makefile
5554
run-make/translation/Makefile
5655
run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile

‎tests/run-make/thumb-none-qemu/Makefile

-27
This file was deleted.
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//! How to run this
2+
//! $ ./x.py clean
3+
//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
4+
//!
5+
//! For supported targets, see `example/.cargo/config`
6+
7+
//@ only-thumb
8+
9+
use std::path::PathBuf;
10+
11+
use run_make_support::{cmd, env_var};
12+
13+
const CRATE: &str = "example";
14+
15+
fn main() {
16+
std::env::set_current_dir(CRATE).unwrap();
17+
18+
let target = env_var("TARGET");
19+
let bootstrap_cargo = env_var("BOOTSTRAP_CARGO");
20+
let path = env_var("PATH");
21+
let rustc = env_var("RUSTC");
22+
23+
let target_dir = PathBuf::from("target");
24+
let manifest_path = PathBuf::from("Cargo.toml");
25+
26+
let debug = {
27+
let mut cmd = cmd(&bootstrap_cargo);
28+
cmd.args(&["run", "--target", &target])
29+
.env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x")
30+
.env("CARGO_TARGET_DIR", &target_dir)
31+
.env("PATH", &path)
32+
.env("RUSTC", &rustc);
33+
cmd.run()
34+
};
35+
36+
let stdout = debug.stdout_utf8();
37+
assert!(stdout.contains("x = 42"), "stdout: {:?}", stdout);
38+
39+
let release = {
40+
let mut cmd = cmd(&bootstrap_cargo);
41+
cmd.args(&["run", "--release", "--target", &target])
42+
.env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x")
43+
.env("CARGO_TARGET_DIR", &target_dir)
44+
.env("PATH", &path)
45+
.env("RUSTC", &rustc);
46+
cmd.run()
47+
};
48+
49+
let stdout = release.stdout_utf8();
50+
assert!(stdout.contains("x = 42"), "stdout: {:?}", stdout);
51+
}

‎tests/run-make/thumb-none-qemu/script.sh

-20
This file was deleted.

0 commit comments

Comments
 (0)
Failed to load comments.