Skip to content

Make the source links really resolve to source files instead of the rendered Doxygen HTML - #14

Merged
tobiaskaestner merged 2 commits into
tkaestner/need-cardsfrom
tkaestner/source-listings
Oct 13, 2026
Merged

tobiaskaestner merged 2 commits into
tkaestner/need-cardsfrom
tkaestner/source-listings

Conversation

@tobiaskaestner

@tobiaskaestner tobiaskaestner commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

The Source link of a test case or procedure, the "Declared in" link of a symbol need and the place of a body in the adequacy table now go to the line in Doxygen's source listing (<file>_source.html#lNNNNN). Before, they went to the rendered member documentation.

  • doxygen_parser.SourcePages reads SOURCE_BROWSER and VERBATIM_HEADERS from Doxyfile.xml and finds the listing of a file by the file compound in index.xml. It does not rebuild Doxygen's escaping of file names. Without a listing, the link stays as it was before.
  • testcoverage: the registry key testmodule.coverage_source_docs names the Doxygen documents to look in, in order. Each builder of the document waits for them. They need the top-level doxygen_xml: true.
  • The XML files that the lookups read are inputs of the document. A new Doxygen run makes Sphinx read the document again.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing build dependencies and incomplete input tracking can produce absent or stale source links.

4 open findings
What changed in this PR

Adds source-listing links for test cases, procedures, symbols, and coverage bodies.

Changes:

  • Resolves Doxygen source pages and line anchors from generated XML.
  • Integrates source links into Sphinx extensions and styling.
  • Adds documentation, fixtures, and tests.
File Description
sphinx/​zdocs_conf.py Exposes Doxygen document metadata.
sphinx/​_static/​zdocs-needs.css Styles coverage source locations.
sphinx/​_scripts/​rst_builders.py Emits source-listing links.
sphinx/​_scripts/​doxygen_parser.py Resolves Doxygen source pages.
sphinx/​_scripts/​_tests/​test_rst_builders.py Tests source-link RST.
sphinx/​_scripts/​_tests/​test_doxygen_parser.py Tests source-page resolution.
sphinx/​_fixtures/​doxygen/​test__queue_8c.xml Adds queue source fixture.
sphinx/​_fixtures/​doxygen/​test__helpers_8c.xml Adds helper source fixture.
sphinx/​_fixtures/​doxygen/​index.xml Indexes fixture source files.
sphinx/​_fixtures/​doxygen/​Doxyfile.xml Enables fixture source browsing.
sphinx/​_fixtures/​doxygen-symbols/​Doxyfile.xml Configures header listings.
sphinx/​_extensions/​test_module.py Links tests and procedures to source.
sphinx/​_extensions/​test_coverage.py Links coverage bodies to source.
sphinx/​_extensions/​symbol_needs.py Links symbol declarations to source.
sphinx/​_extensions/​_tests/​test_test_module.py Tests test-module links.
sphinx/​_extensions/​_tests/​test_symbol_needs.py Tests symbol source links.
sphinx/​_extensions/​_tests/​test_adequacy.py Tests coverage source links.
scripts/​docrefs.py Registers Doxygen XML/HTML locations.
doc/​manual/​reference/​directives-and-roles.rst Documents source-link behavior.
doc/​manual/​howto/​render-test-specifications.rst Documents source-browser setup.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sphinx/_extensions/test_coverage.py
Comment thread sphinx/_extensions/test_coverage.py
Comment on lines +699 to +700
try:
root = ET.parse(self.xml_dir / "index.xml").getroot()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. SourcePages.inputs holds every XML file that it read: Doxyfile.xml, index.xml and each file compound of a lookup. testmodule, symbolneeds and testcoverage record them as inputs of the document after the lookups.

Comment thread doc/manual/reference/directives-and-roles.rst Outdated
tobiaskaestner and others added 2 commits October 13, 2026 20:58
Doxygen writes a source listing of a file (<refid>_source.html, with a
line anchor l%05d) for every code file with SOURCE_BROWSER = YES, and
for the headers with VERBATIM_HEADERS = YES. SourcePages reads the two
options from the Doxyfile.xml beside the XML and finds the listing of
a file by its path.

The Source line of a test case or a procedure now links to its line in
the listing; without listings it links to the group page, as before.
The "Declared in" line of a symbol need links to the declaration's line
in the listing, if there is one.

SourcePages.inputs holds every XML file that it read (Doxyfile.xml,
index.xml and each file compound of a lookup). testmodule and
symbolneeds note them as inputs of the document, so a new Doxygen run
reads the document again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tobias Kaestner <tobias.kaestner@inovex.de>
The place of a body in the adequacy table (kernel/thread.c:344-358)
now links to the first line of the body in a Doxygen source listing.
The registry key testmodule.coverage_source_docs names the Doxygen
documents to look in, in order. zdocs_conf gives it to the build as
testcoverage_source_docs, and each builder of the document waits for
these Doxygen documents (the same stage-2 edge as for doxygen_source).
The registry gives each kind: doxygen document's XML directory and URL
to zdocs_conf as zdocs_doxygen_docs. The XML files that the lookups
read are inputs of the document.

The body path is relative to testmodule_root, so a listing matches if
one path ends with the other and only one file of the document matches.

The form and place of a body is now a paragraph of class zd-adq-loc,
not a role, because a role cannot hold a link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tobias Kaestner <tobias.kaestner@inovex.de>
@tobiaskaestner
tobiaskaestner force-pushed the tkaestner/source-listings branch from 99ec3f6 to e2de78e Compare October 13, 2026 19:06
@tobiaskaestner
tobiaskaestner removed this pull request from stack #15 October 13, 2026 19:09
@tobiaskaestner
tobiaskaestner added this pull request to stack #19 October 13, 2026 19:09
@tobiaskaestner
tobiaskaestner merged commit 70ad1c6 into main Oct 13, 2026
2 checks passed
@tobiaskaestner
tobiaskaestner deleted the tkaestner/source-listings branch October 26, 2026 10:07
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

Successfully merging this pull request may close these issues.

2 participants