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

Option to disable running doctests #14

Closed
Anders429 opened this issue Feb 9, 2022 · 2 comments · Fixed by #18
Closed

Option to disable running doctests #14

Anders429 opened this issue Feb 9, 2022 · 2 comments · Fixed by #18
Labels
duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers

Comments

@Anders429
Copy link

Is there an option somewhere to disable running doctests? I am attempting to run this on a fairly large project with over 50 doctests, but it causes each mutant to take a long time to run. That, combined with a lot of mutations (over 300) makes for a long run-time.

For comparison, running normally takes ~15 seconds for each mutation, which ends up being about an hour and a half. However, if I modify my library's Cargo.toml to disable doctests (setting doctests = false), the time for each mutant reduces to about 1-1.5 seconds each. That ends up being only approximately 7.5 minutes, which is much more desirable, especially if I want to run this in CI.

Is there a way a flag can be added to disable doctests? Or perhaps one already exists? In general, my doctests tend to test things already covered in my unit tests, and serve more as examples in the documentation, so I don't think much is lost by excluding them.

@sourcefrog
Copy link
Owner

Hi, thanks for the feedback.

There is no option for this at the moment but it would definitely make sense to add. Perhaps it should just be done through a general way to pass options to cargo test, because there are others that could be useful too.

Perhaps

cargo mutants -- --all-targets

(does that actually disable doctests? It looks like it.)

@sourcefrog sourcefrog added enhancement New feature or request good first issue Good for newcomers labels Feb 9, 2022
@sourcefrog sourcefrog added the duplicate This issue or pull request already exists label Feb 10, 2022
@sourcefrog
Copy link
Owner

Basically the same as #15 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants