chiark / gitweb /
documentation/doxygen: robustly skip unexpected XML files.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 9 Jan 2022 18:01:59 +0000 (19:01 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 9 Jan 2022 21:50:15 +0000 (22:50 +0100)
commit45911a188292a62b49ca4b226f590e9ca8cb75fa
tree350175a812a6c9c10ef38704a528360a9c02e449
parent4ec09a2c97f60c2c673de337d7dabdc198592f4a
documentation/doxygen: robustly skip unexpected XML files.

This skips the Doxyfile.xml from 1.8.19 (without a warning, to avoid
polluting the output for everyone running newer Doxygen), and
additionally also all other files that don't have the expected root or
immediately following tags (with a warning, because that's likely
something to act on).

These checks used to be inconsistent between extract_metadata() and
parse_xml() (resulting extract_metadata() to continuing further and
dying on some other exception, sigh) and also was an assert instead of a
graceful handling.

A new test case is added to verify that all expected messages are
printed, all unexpected files are skipped but also the expected files
are not skipped. The warnings/errors are also printed just once, not
once during metadata extraction and once during actual page generation.

Co-authored-by: crf8472 <crf8472@web.de>
Co-authored-by: SRGDamia1 <sdamiano@stroudcenter.org>
12 files changed:
documentation/doxygen.py
documentation/test_doxygen/contents_parse_error/Doxyfile [deleted file]
documentation/test_doxygen/contents_parse_error/broken.xml [deleted file]
documentation/test_doxygen/ignored_xmls/Doxyfile [new file with mode: 0644]
documentation/test_doxygen/ignored_xmls/Doxyfile.xml [new file with mode: 0644]
documentation/test_doxygen/ignored_xmls/Foxydile.xml [new file with mode: 0644]
documentation/test_doxygen/ignored_xmls/broken.xml [new file with mode: 0644]
documentation/test_doxygen/ignored_xmls/index.xml [new file with mode: 0644]
documentation/test_doxygen/ignored_xmls/pages.html [new file with mode: 0644]
documentation/test_doxygen/ignored_xmls/thingsgotcrazy.xml [new file with mode: 0644]
documentation/test_doxygen/test_contents.py
documentation/test_doxygen/test_ignored_xmls.py [new file with mode: 0644]