[igt-dev] [PATCH i-g-t v2 0/1] Add a script to allow inlined test documentation

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Thu Feb 9 11:57:11 UTC 2023


From: Mauro Carvalho Chehab <mchehab at kernel.org>

Keeping documentation updated is hard, as text documents gets outdated
when code changes. The best practices are to keep documentation as close
as possible to the code.

This script allows adding documentation inside special tags at the
C files, and validate if the documentation actually meets the code.

It is meant to be used by the new Intel Xe driver, in the process of
being upstreamed. It can be used also for other drivers, as well.

This is a version of my previous script, that got translated to Python.

It supports three modes of operation:

1) Output documentation in ReST format (default if no arg provided):

	$ scripts/igt-doc.py --files tests/xe/*.c --rest

2) Output a list of tests that are documented

	$ scripts/igt-doc.py --files tests/xe/*.c --show-subtests

3) Compare the documented testlists with IGT runner testlist:

	$ scripts/igt-doc.py --files tests/xe/*.c --check-testlist

The idea is to add automation to generate the ReST files at the
Xe meson.build file. Once all documentation for Xe is placed inline,
the CI for it can also use this script to discover documentation
gaps.

v2:

- use a class for the testlist;
- remove some code duplication related to subtest expansion;
- cosmetic changes to make pylint happy.

Mauro Carvalho Chehab (1):
  scripts:igt-doc.py: add a parser to document tests inlined

 scripts/igt_doc.py | 487 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 487 insertions(+)
 create mode 100755 scripts/igt_doc.py

-- 
2.39.0



More information about the igt-dev mailing list