Make cargo-miri run documentation tests#1671
Make cargo-miri run documentation tests#1671teryror wants to merge 11 commits intorust-lang:masterfrom
Conversation
|
I had completely forgotten about Given this still requires a newer rustdoc, I don't expect this to pass CI though. |
|
Thanks a lot for this PR! I have this in my queue of things to do. Unfortunately, I am pretty busy currently and reviewing these PRs is but one of many things competing for my spare time, so it might take a week or more until I get around to taking a closer look at this. Sorry for that. |
|
No worries, take all the time you need! |
|
Has the rustdoc change landed in the rustc repository in the mean time? Can you rebase this PR over Miri master? That should now work with latest rustc. |
This has been merged for about a week now, yes. I rolled up all of your suggestions into a single commit, then rebased and force-pushed, we should be good to go. Let's see what CI has to say about it. |
I'd prefer if you could avoid squashing while we are still doing review. That makes my job much easier as it means I do not have to re-read all your code. :)
Is the version in |
|
Argh, sorry about that. Good thing this was mostly about adding more comments. The |
Looks like cargo by default does not run doctests in cross-mode, but an experimental feature exists to fix that: rust-lang/cargo#7040. Maybe our test suite could use that? |
|
☔ The latest upstream changes (presumably #1675) made this pull request unmergeable. Please resolve the merge conflicts. |
|
That should do it, I think. I'll get around to merging this with #1675 later today, maybe tomorrow. Edit: Oops, forgot to save after adding a comment. |
|
Getting this to work locally was actually pretty easy, but the CI setup really doesn't like the Furthermore, I don't think Soo, I'll have to revise this some more, I guess. |
|
Not supporting cross-running of doctests at first is also fine, if it turns out to be hard (and it seems like it does^^). You can use the existing |
|
Sounds good to me. I should be able to finish up by tomorrow in that case :) If no one else picks this up, I should be able to set some time aside to investigate cross-running starting around mid-March (I have exams coming up until then). |
Awesome. :) Once this lands, it's probably best to create an issue and leave such notes there. And good call on not letting Miri distract you too much from your exams 👍 |
|
@teryror I'm sorry I lost track... is this PR waiting for me to review it, or do you have further changes planned? |
|
This is ready for review, yes, probably should have pinged you about that, sorry. I didn't rebase in a week or so, no changes planned besides that. |
| test("`cargo miri test` (raw-ptr tracking)", | ||
| cargo_miri("test"), | ||
| "test.default.stdout.ref", rustdoc_ref, | ||
| default_ref, "test.stderr-empty.ref", |
There was a problem hiding this comment.
Can you change one of these tests to also pass --no-doc, just to make sure that that actually has the intended effect?
|
This looks great, I just have some minor nits. :) |
This comment has been minimized.
This comment has been minimized.
|
This PR does not pass a test that will be introduced in #1709: DetailsThis can fix it (feel free to cherry-pick it, but it duplicates some |
|
☔ The latest upstream changes (presumably #1710) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@teryror I haven't heard from you in a while, so I assume you moved on to other things. Thanks a lot for this PR! I will take over and finish it so that it can hopefully land soon. :) |
|
Closing in favor of #1757. |
This would resolve #584.
It Works On My Machine. Specifically, it needs a version of rustdoc with this change, which was only merged yesterday, i.e. it needs the most recent nightly build. With that, I can run the entire coca test suite successfully, which is what I used for testing this feature. Verbose output and/or purposefully changing a doc-test to fail confirm this is working as intended, and not just reported incorrectly.
However, updating
rustc-versionbreaks several tests from Miri's own test suite, so merging this will have to wait. Still, I'm sure this would benefit a lot from code review and testing on other projects, in other build environments.