Skip to content

Commit

Permalink
Test no-std
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed Oct 30, 2024
1 parent bb11066 commit df2cdba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: cross test --target ${{ matrix.target }} --no-default-features

darwin:
runs-on: ${{ matrix.os }}
Expand All @@ -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
Expand All @@ -112,6 +118,9 @@ jobs:
- name: Test with Itanium backend
if: matrix.abi == 'gnu'
run: set LITHIUM_BACKEND=itanium && cargo test
- name: Test without std
if: matrix.abi == 'msvc'
run: cargo test --no-default-features

miri-linux:
runs-on: ubuntu-latest
Expand All @@ -136,6 +145,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
Expand All @@ -151,8 +162,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:
Expand Down Expand Up @@ -180,3 +193,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
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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"),
Expand Down

0 comments on commit df2cdba

Please sign in to comment.