Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,25 @@ jobs:
echo "${{ runner.tool_cache }}/wasmtime-v24.0.0-x86_64-linux" >> $GITHUB_PATH
echo "CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime run --" >> $GITHUB_ENV
- run: cargo test --target wasm32-wasip1 --all -- --nocapture

miri-test:
name: Test stacker with Miri on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Rust nightly with Miri
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: miri
default: true
- name: Setup Miri
run: cargo miri setup
- name: Test with Miri
run: cargo miri test -- --nocapture
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ psm_stack_manipulation! {
}

no {
#[cfg(not(windows))]
#[cfg(not(all(windows, not(miri))))]
fn _grow(stack_size: usize, callback: &mut dyn FnMut()) {
let _ = stack_size;
callback();
}
#[cfg(windows)]
#[cfg(all(windows, not(miri)))]
use backends::windows::_grow;
}
}
1 change: 1 addition & 0 deletions tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn recurse(n: usize) {
}

#[test]
#[cfg_attr(miri, ignore)] // Too slow under Miri's interpreter
fn foo() {
let limit = if cfg!(target_arch = "wasm32") {
2000
Expand Down
3 changes: 2 additions & 1 deletion tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn deep() {
}
}

let limit = if cfg!(target_arch = "wasm32") {
let limit = if cfg!(target_arch = "wasm32") || cfg!(miri) {
2000
} else {
256 * 1024
Expand All @@ -31,6 +31,7 @@ fn deep() {

#[test]
#[cfg_attr(target_arch = "wasm32", ignore)]
#[cfg_attr(miri, ignore)] // Too slow under Miri's interpreter
fn panic() {
fn foo(n: usize, s: &mut [u8]) {
__stacker_black_box(s.as_ptr());
Expand Down
Loading