From 246505805a73eec90d93a9edd5916093050b8f5e Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Sun, 24 May 2026 13:23:44 +0100 Subject: [PATCH] PoC: add no-std libm tests to CI --- .github/workflows/ci.yml | 19 +++++++++++++++++++ Cargo.toml | 2 +- fearless_simd_tests/Cargo.toml | 7 ++++++- fearless_simd_tests/tests/mod.rs | 1 + 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01cd78a21..9000de579 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -219,6 +219,25 @@ jobs: - name: cargo test run: cargo test --workspace --locked --all-features --no-fail-fast --target ${{ matrix.platform.target }} + test-stable-libm: + name: cargo test (libm, no_std) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: install stable toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_STABLE_VER }} + + - name: restore cache + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.event_name != 'merge_group' }} + + - name: cargo test + run: cargo test -p fearless_simd_tests --locked --no-default-features --features libm --no-fail-fast + test-sde: name: cargo test in an emulator runs-on: ${{ matrix.platform.os }} diff --git a/Cargo.toml b/Cargo.toml index 0158a30a3..cab6e8ed2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ clippy.wildcard_dependencies = "warn" clippy.uninlined_format_args = "allow" [workspace.dependencies] -fearless_simd = { path = "fearless_simd" } +fearless_simd = { path = "fearless_simd", default-features = false } fearless_simd_dev_macros = { path = "fearless_simd_dev_macros" } proc-macro2 = "1.0.95" syn = { version = "2.0.101", features = ["full", "extra-traits"] } diff --git a/fearless_simd_tests/Cargo.toml b/fearless_simd_tests/Cargo.toml index 16fcf8f8c..4f1041a14 100644 --- a/fearless_simd_tests/Cargo.toml +++ b/fearless_simd_tests/Cargo.toml @@ -19,6 +19,11 @@ path = "tests/mod.rs" [lints] workspace = true +[features] +default = ["std"] +std = ["fearless_simd/std"] +libm = ["fearless_simd/libm"] + [dependencies] -fearless_simd = { workspace = true, features = ["std"] } +fearless_simd = { workspace = true } fearless_simd_dev_macros = { workspace = true } diff --git a/fearless_simd_tests/tests/mod.rs b/fearless_simd_tests/tests/mod.rs index 4d2f053d8..421a28791 100644 --- a/fearless_simd_tests/tests/mod.rs +++ b/fearless_simd_tests/tests/mod.rs @@ -27,6 +27,7 @@ fn generic_cast(x: S::f32s) -> S::u32s { dead_code, reason = "The `UNSUPPORTED_LEVEL_MESSAGE` is only used in some cfgs." )] +#[cfg(any(feature = "std", target_arch = "wasm32"))] #[test] fn supports_highest_level() { const UNSUPPORTED_LEVEL_MESSAGE: &str = "This means that some of the other tests in this run may be false positives, that is, they have been marked as succeeding even though they would actually fail if they could run.\n\