Re: [PATCH] docs: Makefile: Add a testdocs target for the documentation unit tests
From: Breno Leitao
Date: Thu Sep 17 2026 - 03:57:07 EST
On Wed, Sep 16, 2026 at 11:41:11AM -0700, Kees Cook wrote:
> tools/unittests/run.py discovers and runs the unit tests there (which
> are primarily documentation tools), but nothing in the build calls it,
> so the tests are only run by whoever remembers that the script is there.
>
> Give it a target, next to the other checks that need no Sphinx. The name
> ends in "docs", so it matches the "%docs" pattern already in
> no-dot-config-targets and runs without a configured tree, and it sets
> PYTHONPYCACHEPREFIX as the other Python targets here do, to keep
> __pycache__ directories out of the source tree.
>
> $ make testdocs
> ...
> Ran 121 tests
Very nice! Thanks!
> with "make dochelp" listing it between refcheckdocs and cleandocs.
>
> Tested with GNU Make 4.4.1 and Python 3.14.7, on a tree with no .config,
> where it ran 121 tests and left no __pycache__ behind.
>
> Assisted-by: LLM
> Signed-off-by: Kees Cook <kees@xxxxxxxxxx>
Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>