Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide for running doctest #4393

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Add guide for running doctest #4393

merged 2 commits into from
Jan 7, 2025

Conversation

Spxg
Copy link
Contributor

@Spxg Spxg commented Jan 5, 2025

This is what I learned recently when trying to run doctests:
image

image

If you also need to run doctests, add the [`-Zdoctest-xcompile`](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile) flag:

```
cargo -Zdoctest-xcompile test --target wasm32-unknown-unknown
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like a positional argument this way, so lets put it at the end:

Suggested change
cargo -Zdoctest-xcompile test --target wasm32-unknown-unknown
cargo test --target wasm32-unknown-unknown -Zdoctest-xcompile

Comment on lines 137 to 141
If you are in the stable channel, you can switch to nightly like this:

```
cargo +nightly -Zdoctest-xcompile test --target wasm32-unknown-unknown
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead we should note that his is an unstable feature that requires Rust nightly and merge these two blocks.

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Thank you!

@daxpedda daxpedda merged commit c9ee617 into rustwasm:main Jan 7, 2025
48 checks passed
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.

2 participants