For each of the filetypes, the script uses universal-ctags binary to generate a tags file for all the unit tests for the given filetype, collects the kinds contained in the tags file and compares them to those mapped inside `tm_parser.c` (except the ignored ones mapped to `tm_tag_undef_t`). It then prints those kinds that are mapped in tm_parser.c but not present in the ctags output.
The script runs a universal-ctags binary that must be present in PATH and the script assumes it's executed from the root directory containing Geany sources (by `./scripts/test-units.py`). Since Geany now uses most of the upstream parser, the output of universal-ctags should correspond to the output of Geany. Note that we cannot use our own tags file for this test as they don't contain the original kind but rather the kind mapped to Geany's internal representation (`tm_tag_..._t`).
I'll update this PR once all the parsers are merged. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3182
-- Commit Summary --
* Add script checking our unit test coverage of the mapped kinds
-- File Changes --
A scripts/test-units.py (121)
-- Patch Links --
https://github.com/geany/geany/pull/3182.patch https://github.com/geany/geany/pull/3182.diff
Cool! LGTM. Maybe we could add parts of the PR's description to the script itself to explain what it is doing and what the output means.
github-comments@lists.geany.org