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

Fix C coverage support for sphinx.ext.coverage #11591

Merged
merged 4 commits into from Aug 15, 2023

Conversation

stephenfin
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Purpose

We were using the objects attribute of the C domain to pull all C objects that we were aware of. However, this is never set to any value nor does it ever appear to have been. Instead, we should have been using and parsing the return value from get_objects.

As an aside, this would suggest code coverage for C APIs has never worked or at least has not worked for a very long time. This explains why every GitHub hit for the various configuration options comes from Sphinx (for the implementation), Python (for the sole user), or a fork of these. This might be a good time to deprecate and remove this aspect of the coverage extension. We can discuss that elsewhere.

Detail

Relates

(none)

Signed-off-by: Stephen Finucane <stephen@that.guru>
We were using the 'objects' attribute of the C domain to pull all C
objects that we were aware of. However, this is never set to any value
nor does it ever appear to have been. Instead, we should have been using
and parsing the return value from 'get_objects'.

As an aside, this would suggest code coverage for C APIs has never
worked or at least has not worked for a *very* long time. This explains
why every GitHub hit for the various configuration options comes from
Sphinx (for the implementation), Python (for the sole user), or a fork
of these.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Prevent regressions but including a positive test alongside the negative
test. We could probably make this more thorough and improve the C source
so that it shows examples of other types of C object, but that's a task
left for another day/PR.

Signed-off-by: Stephen Finucane <stephen@that.guru>
@AA-Turner
Copy link
Member

AA-Turner commented Aug 15, 2023

@stephenfin please could you add a note to CHANGES? I'd like to include this in 7.2.

A

Signed-off-by: Stephen Finucane <stephen@that.guru>
@stephenfin
Copy link
Contributor Author

@stephenfin please could you add a note to CHANGES? I'd like to include this in 7.2.

Done 👍

@AA-Turner AA-Turner merged commit 53a930f into sphinx-doc:master Aug 15, 2023
26 of 27 checks passed
@AA-Turner
Copy link
Member

Thanks!

@stephenfin stephenfin deleted the issues/11590 branch August 15, 2023 15:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants