From e2b05ce19c48f34b0fbf3661a6079157eff26fa7 Mon Sep 17 00:00:00 2001 From: iximeow Date: Thu, 6 Feb 2025 00:19:11 -0800 Subject: actually check no-std configuration does not transitively depend on std --- goodfile | 3 +++ tests/no_std_check/.gitignore | 1 + tests/no_std_check/Cargo.toml | 24 ++++++++++++++++++++++++ tests/no_std_check/src/main.rs | 11 +++++++++++ 4 files changed, 39 insertions(+) create mode 100644 tests/no_std_check/.gitignore create mode 100644 tests/no_std_check/Cargo.toml create mode 100644 tests/no_std_check/src/main.rs diff --git a/goodfile b/goodfile index b82f577..1105a7a 100644 --- a/goodfile +++ b/goodfile @@ -13,4 +13,7 @@ Step.advance("test") Build.run({"cargo", "test"}, {name="test stdlib/fmt"}) Build.run({"cargo", "test", "--no-default-features"}, {name="test nostdlib/fmt"}) +Build.run({"cargo", "rustc", "--", "-C", "link-arg=-nostartfiles"}, {cwd="tests/no_std_check"}) +Build.run({"cargo", "rustc", "--release", "--", "-C", "link-arg=-nostartfiles"}, {cwd="tests/no_std_check"}) + Build.run({"cargo", "build", "--release"}, {cwd="differential-tests", name="build capstone differential"}) diff --git a/tests/no_std_check/.gitignore b/tests/no_std_check/.gitignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/tests/no_std_check/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/tests/no_std_check/Cargo.toml b/tests/no_std_check/Cargo.toml new file mode 100644 index 0000000..f5ad827 --- /dev/null +++ b/tests/no_std_check/Cargo.toml @@ -0,0 +1,24 @@ +[package] + +name = "no-std-test" +version = "0.0.1" +authors = ["iximeow "] +license = "0BSD" +description = "test crate to check that yaxpeax-arm is actually no-stds" +edition = "2021" +publish = false + +[[bin]] +name = "no-std-test" +path = "src/main.rs" + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" + +[dependencies] +yaxpeax-arm = { path = "../..", default-features = false } + +[workspace] diff --git a/tests/no_std_check/src/main.rs b/tests/no_std_check/src/main.rs new file mode 100644 index 0000000..73b5d56 --- /dev/null +++ b/tests/no_std_check/src/main.rs @@ -0,0 +1,11 @@ +#![no_std] +#![no_main] + +#[allow(unused_imports)] +use yaxpeax_arm; + +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { loop {} } + +#[no_mangle] +pub extern "C" fn _start() -> ! { loop {} } -- cgit v1.1