From 7f245c476db47073ea1c5944ed320b6ee63dab9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 9 Jan 2022 23:45:36 +0100 Subject: [PATCH] documentation/doxygen: ah so that's why the warning is uncovered. Because 1.8.16+ just directly drops the whole tag if the source doesn't exist. What a marvellous idea!!! --- documentation/doxygen.py | 3 ++ .../contents_dot/warnings_1815.html | 35 +++++++++++++++++++ documentation/test_doxygen/test_contents.py | 15 ++++++++ 3 files changed, 53 insertions(+) create mode 100644 documentation/test_doxygen/contents_dot/warnings_1815.html diff --git a/documentation/doxygen.py b/documentation/doxygen.py index e29d4f36..fb1d2c3a 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -1054,6 +1054,9 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. if 'name' in i.attrib: with open(i.attrib['name'], 'r') as f: source = f.read() + # Since 1.8.16 the whole tag is dropped if the file + # doesn't exist. Such a great solution that it's unfathomable. + # FFS. else: logging.warning("{}: file passed to @dotfile was not found, rendering an empty graph".format(state.current)) source = 'digraph "" {}' diff --git a/documentation/test_doxygen/contents_dot/warnings_1815.html b/documentation/test_doxygen/contents_dot/warnings_1815.html new file mode 100644 index 00000000..56bb6222 --- /dev/null +++ b/documentation/test_doxygen/contents_dot/warnings_1815.html @@ -0,0 +1,35 @@ + + + + + warnings | My Project + + + + + +
+
+
+
+
+

+ warnings +

+

This file doesn't exist:

+ + + +
+
+
+
+
+ + diff --git a/documentation/test_doxygen/test_contents.py b/documentation/test_doxygen/test_contents.py index 5215edf8..58467601 100644 --- a/documentation/test_doxygen/test_contents.py +++ b/documentation/test_doxygen/test_contents.py @@ -423,10 +423,25 @@ class Dot(IntegrationTestCase): self.assertEqual(*self.actual_expected_contents('index.html', file)) + @unittest.skipUnless(LooseVersion(doxygen_version()) >= LooseVersion("1.8.16"), + "1.8.16+ drops the whole tag if the file doesn't exist, which is incredibly dumb") def test_warnings(self): + # No warnings should be produced here + # TODO use self.assertNoLongs() on 3.10+ self.run_doxygen(wildcard='warnings.xml') self.assertEqual(*self.actual_expected_contents('warnings.html')) + @unittest.skipUnless(LooseVersion(doxygen_version()) < LooseVersion("1.8.16"), + "1.8.16+ drops the whole tag if the file doesn't exist, which is incredibly dumb") + def test_warnings_1815(self): + with self.assertLogs() as cm: + self.run_doxygen(wildcard='warnings.xml') + + self.assertEqual(*self.actual_expected_contents('warnings.html', 'warnings_1815.html')) + self.assertEqual(cm.output, [ + "WARNING:warnings.xml: file passed to @dotfile was not found, rendering an empty graph" + ]) + class HtmlonlyHtmlinclude(IntegrationTestCase): def test_htmlinclude(self): self.run_doxygen(wildcard='indexpage.xml') -- 2.30.2