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

should_panic marker not honored in README.md doctest #991

Closed
nu11ptr opened this issue Apr 16, 2022 · 4 comments
Closed

should_panic marker not honored in README.md doctest #991

nu11ptr opened this issue Apr 16, 2022 · 4 comments
Assignees

Comments

@nu11ptr
Copy link

nu11ptr commented Apr 16, 2022

When using a doctest in a README.md file marked with should_panic, tarpaulin executes it but does not seem to parse out the should_panic as it ends in failure. Removing the should_panic flag (and removing the failing assert) and it passes as expected.

My repo is very small so can probably be used as a reproducible sample:

README:
https://github.com/nu11ptr/assert_unordered/blame/master/README.md#L25

Code that triggers README test:
https://github.com/nu11ptr/assert_unordered/blob/master/src/lib.rs#L40

I was expecting (or at least hoping) the test would pass like it does when executed with cargo test

@xd009642
Copy link
Owner

This looks like a duplicate of #924 and this comment explains what is happening #924 (comment) aside from better upstream support in rustc or the attribute finding code expanding preprocessor includes of text the only approach I could think of would be a hacky flag like --doctests-always-pass

@nu11ptr
Copy link
Author

nu11ptr commented Apr 16, 2022

Appreciate the fast response. Other than disabling my README test, any ideas for how to get tarpaulin to just skip this test, but not cargo test? Otherwise I'll probably just have to disable the README test for now, thx.

@xd009642
Copy link
Owner

There's the ignore attribute on doc tests, as described in the doctest docs. Other than that not running tarpaulin for doc tests

@xd009642
Copy link
Owner

Going to close this as duplicated, I also don't see myself supporting the include macros for doc tests in the near future (unfortunately)

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

No branches or pull requests

2 participants