if i.tail: out += html.escape(i.tail)
+ # Warn if suspicious stuff is present
+ if '_EXPORT' in out or '_LOCAL' in out:
+ logging.warning("{}: type contains an export macro: {}".format(state.current, ''.join(type.itertext())))
+
# Remove spacing inside <> and before & and *
return fix_type_spacing(out)
--- /dev/null
+INPUT = File.h
+QUIET = YES
+GENERATE_HTML = NO
+GENERATE_LATEX = NO
+GENERATE_XML = YES
+PREDEFINED = DOXYGEN_GENERATING_OUTPUT
+
+# Enable to get rid of the MAGNUM_EXPORT macro in the output
+# MACRO_EXPANSION = YES
+
+M_PAGE_FINE_PRINT =
+M_THEME_COLOR =
+M_LINKS_NAVBAR1 =
+M_LINKS_NAVBAR2 =
--- /dev/null
+#ifndef DOXYGEN_GENERATING_OUTPUT
+#define MAGNUM_EXPORT __attribute__ ((visibility ("default")))
+#else
+#define MAGNUM_EXPORT
+#endif
+
+/** @brief Root namespace */
+namespace Magnum {
+
+/** @brief Always returns `true` */
+constexpr bool MAGNUM_EXPORT hasCoolThings() { return true; }
+
+}
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Magnum namespace | 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+doxygen.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-9 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>Magnum <span class="m-thin">namespace</span></h1>
+ <p>Root namespace.</p>
+ <div class="m-block m-default">
+ <h3>Contents</h3>
+ <ul>
+ <li>
+ Reference
+ <ul>
+ <li><a href="#func-members">Functions</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <section id="func-members">
+ <h2><a href="#func-members">Functions</a></h3>
+ <dl class="m-dox">
+ <dt>
+ <span class="m-dox-wrap-bumper">auto <a href="#a7f3d59790996b9f86ca6d4adc63549e2" class="m-dox-self" name="a7f3d59790996b9f86ca6d4adc63549e2">hasCoolThings</a>(</span><span class="m-dox-wrap">) -> bool MAGNUM_EXPORT <span class="m-label m-flat m-primary">constexpr</span></span>
+ </dt>
+ <dd>Always returns <code>true</code></dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
def test_empty_class_doc_not_generated(self):
self.run_dox2html5(index_pages=[], wildcard='classBrief.xml')
self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'classBrief.html')))
+
+class Warnings(IntegrationTestCase):
+ def __init__(self, *args, **kwargs):
+ super().__init__(__file__, 'warnings', *args, **kwargs)
+
+ def test(self):
+ # Should warn that an export macro is present in the XML
+ self.run_dox2html5(wildcard='namespaceMagnum.xml')
+ self.assertEqual(*self.actual_expected_contents('namespaceMagnum.html'))