Skip to content

Run tests on wasm32 architecture#269

Merged
jan-ferdinand merged 4 commits intomasterfrom
wasm_tests
Jan 15, 2026
Merged

Run tests on wasm32 architecture#269
jan-ferdinand merged 4 commits intomasterfrom
wasm_tests

Conversation

@jan-ferdinand
Copy link
Copy Markdown
Member

@jan-ferdinand jan-ferdinand commented Jun 26, 2025

Convince all dependencies and tests that they should run on wasm32 architectures.

TODO

  • Get proptest-arbitrary-interop to play ball, ideally through add support for building wasm32 target graydon/proptest-arbitrary-interop#3
  • change #[test] annotations into #[macro_rules_attr::apply(test)] (see corresponding WIP commit)
  • set up CI script to build and test everything on wasm32-unknown-unknown target
  • think about README structure – include README-wasm32.md in README? Link to it? …?
  • try to make crate-type = ["cdylib", "rlib"] specific to the wasm32 target I don't know if or how this can be achieved

This is a continuation of #265.

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 26, 2025

Coverage Status

coverage: 97.336% (-0.3%) from 97.642%
when pulling f4951a1 on wasm_tests
into 23d175e on master.

@codspeed-hq

This comment was marked as off-topic.

@jan-ferdinand jan-ferdinand force-pushed the wasm_tests branch 2 times, most recently from 491305c to c49c49e Compare January 15, 2026 09:04
@jan-ferdinand jan-ferdinand force-pushed the wasm_tests branch 4 times, most recently from ab40f85 to 069656c Compare January 15, 2026 10:50
@jan-ferdinand jan-ferdinand marked this pull request as ready for review January 15, 2026 11:33
Copy link
Copy Markdown
Member

@Sword-Smith Sword-Smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dan-da and others added 4 commits January 15, 2026 16:26
Add the necessary `Cargo.toml` magic for `cargo test` to build `#[test]`
and `#[proptest]` tests correctly. However the wasm test harness
ignores `#[test]` and `#[proptest]`, so tests are not actually run on
wasm targets when running `cargo test`. Instead, use the
`#[wasm_bindgen_test]` annotation to enable tests on wasm targets.

Also enables compilation on 32-bit architectures by correcting the NTT's
`NUM_DOMAINS` to 29 on 32-bit systems. It remains unchanged at 32 on 64
bit systems.
The crate is unmaintained and, for the purpose of testing on wasm32,
unusable. Because

1. the code has seen very little activity since its inception,
2. there are only a little more than 100 lines of code, and
3. it has worked perfectly well for all our needs so far,

I think the risks associated with inlining are acceptable.
@jan-ferdinand jan-ferdinand merged commit c5b5e5f into master Jan 15, 2026
24 checks passed
@jan-ferdinand jan-ferdinand deleted the wasm_tests branch January 15, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants