if 'name' in i.attrib:
with open(i.attrib['name'], 'r') as f:
source = f.read()
+ # Since 1.8.16 the whole <dotfile> 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 "" {}'
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>warnings | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ warnings
+ </h1>
+<p>This file doesn't exist:</p><div class="m-graph"><svg style="width: 0.500rem; height: 0.500rem;" viewBox="0.00 0.00 8.00 8.00">
+<g transform="scale(1 1) rotate(0) translate(4 4)">
+</g>
+</svg>
+</div>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
self.assertEqual(*self.actual_expected_contents('index.html', file))
+ @unittest.skipUnless(LooseVersion(doxygen_version()) >= LooseVersion("1.8.16"),
+ "1.8.16+ drops the whole <dotfile> 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 <dotfile> 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')