-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
tarpaulin fails to run doc-test in readme #924
Comments
i'm sorry to keep popping up like this! |
tried adding some test cases in #926, as i thought it was time you got a pull request from me instead of just issues. It's not a complete test though. From the code I would imagine it should work, since you're just searching an entire file for the text 'no_run'. Shouldn't matter how the attributes are formatted. Which i guess means the actual issue is a little more subtle |
Ah I gave it a moments thought and I see what happened. So when you run cargo test for doc tests the no-run etc is chosen after it builds the doc tests. But I don't get that meta information. And the binary name for the generated doc test is generated from file name and line number of the doc test (with an addition number at the end as name collisions are possible). So I get a list of doc tests and from them work out potential source locations for the doc test. And then map the attributes at those locations to the guessed source location (guessed because there can be collisions). Now obviously this doesn't currently handle Also, for generated code that may be in I won't have time today or tomorrow to work on this, but I'll aim to get to it during the week at some point. If you want to work on it though I'm fine with that just ideally let me know so there's not too much duplicated effort 😅 |
Any possibility of better upstream support from Cargo? |
Potentially, I believe the code responsible for it is in rustc, it is an area which currently has no stability guarantees (to my knowledge). But I'll raise something this week and see if anyone has objections |
I have a doc-test in my README, which i'm including like so-
this works a treat for making sure my readme stays aligned with the code, but tarpaulin doesn't seem to like it.
You can see the job output here- https://github.com/danieleades/config2/runs/4693934507?check_suite_focus=true
the code example has a
no_run
annotation, whichcargo test
is respecting, but tarpaulin apparently isn'tThe text was updated successfully, but these errors were encountered: