From 6d768303ea667337640c8b753c0830354a57d683 Mon Sep 17 00:00:00 2001 From: Alisa Sireneva Date: Wed, 30 Oct 2024 23:24:19 +0300 Subject: [PATCH] Test no-std --- .github/workflows/ci.yml | 17 ++++++++++++++++- src/lib.rs | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2260f7..00a7e84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,8 @@ jobs: run: LITHIUM_BACKEND=panic cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} - name: Test with Itanium backend run: LITHIUM_BACKEND=itanium cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} + - name: Test without std + run: cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} --no-default-features linux-cross: runs-on: ubuntu-latest @@ -69,6 +71,8 @@ jobs: run: LITHIUM_BACKEND=panic cross test --target ${{ matrix.target }} - name: Test with Itanium backend run: LITHIUM_BACKEND=itanium cross test --target ${{ matrix.target }} + - name: Test without std + run: cargo test --target ${{ matrix.target }} --no-default-features darwin: runs-on: ${{ matrix.os }} @@ -88,6 +92,8 @@ jobs: run: LITHIUM_BACKEND=panic cargo test - name: Test with Itanium backend run: LITHIUM_BACKEND=itanium cargo test + - name: Test without std + run: cargo test windows: runs-on: windows-latest @@ -112,6 +118,8 @@ jobs: - name: Test with Itanium backend if: matrix.abi == 'gnu' run: set LITHIUM_BACKEND=itanium && cargo test + - name: Test without std + run: cargo test --no-default-features miri-linux: runs-on: ubuntu-latest @@ -136,6 +144,8 @@ jobs: run: LITHIUM_BACKEND=panic cargo miri test --target ${{ matrix.target }} - name: Test with Itanium backend run: LITHIUM_BACKEND=itanium cargo miri test --target ${{ matrix.target }} + - name: Test without std + run: cargo miri test --target ${{ matrix.target }} --no-default-features valgrind: runs-on: ubuntu-latest @@ -151,8 +161,10 @@ jobs: run: LITHIUM_BACKEND=panic cargo valgrind test - name: Test with Itanium backend run: LITHIUM_BACKEND=itanium cargo valgrind test + - name: Test without std + run: cargo valgrind test --no-default-features - test_stable: + test-stable: runs-on: ubuntu-latest if: success() || failure() steps: @@ -180,3 +192,6 @@ jobs: run: LITHIUM_BACKEND=${{ matrix.backend }} cargo fmt -- --check - name: Clippy run: LITHIUM_BACKEND=${{ matrix.backend }} cargo clippy -- -D warnings + - name: Clippy without std + if: matrix.backend != 'panic' + run: LITHIUM_BACKEND=${{ matrix.backend }} cargo clippy --no-default-features -- -D warnings diff --git a/src/lib.rs b/src/lib.rs index defa3c4..013be54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,7 @@ //! used by the crate match, all safe user-supplied callbacks are sound to call, because safe //! callbacks can only interact with exceptions in an isolated manner. -#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(not(any(feature = "std", test)), no_std)] #![cfg_attr(not(feature = "std"), feature(thread_local))] #![cfg_attr( any(backend = "itanium", backend = "seh"),