chiark / gitweb /
documentation: test that shows empty page issue.
authorCris Luengo <cris.l.luengo@gmail.com>
Tue, 7 May 2019 05:13:58 +0000 (23:13 -0600)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 7 Jul 2019 12:21:08 +0000 (14:21 +0200)
documentation/test_doxygen/page_empty_page/Doxyfile [new file with mode: 0644]
documentation/test_doxygen/page_empty_page/input.h [new file with mode: 0644]
documentation/test_doxygen/page_empty_page/input.md [new file with mode: 0644]
documentation/test_doxygen/page_empty_page/pages.html [new file with mode: 0644]
documentation/test_doxygen/test_page.py

diff --git a/documentation/test_doxygen/page_empty_page/Doxyfile b/documentation/test_doxygen/page_empty_page/Doxyfile
new file mode 100644 (file)
index 0000000..7c1670c
--- /dev/null
@@ -0,0 +1,13 @@
+INPUT                   = input.h input.md
+QUIET                   = YES
+GENERATE_HTML           = NO
+GENERATE_LATEX          = NO
+GENERATE_XML            = YES
+XML_PROGRAMLISTING      = NO
+
+##! M_PAGE_FINE_PRINT   =
+##! M_THEME_COLOR       =
+##! M_FAVICON           =
+##! M_LINKS_NAVBAR1     =
+##! M_LINKS_NAVBAR2     =
+##! M_SEARCH_DISABLED   = YES
diff --git a/documentation/test_doxygen/page_empty_page/input.h b/documentation/test_doxygen/page_empty_page/input.h
new file mode 100644 (file)
index 0000000..14461ab
--- /dev/null
@@ -0,0 +1,14 @@
+/** @defgroup bla A module
+@brief Short module description
+
+@{ */
+
+/** @brief A namespace */
+namespace Foo {
+
+/** @brief A class */
+class Bar {};
+
+}
+
+/*@}*/
diff --git a/documentation/test_doxygen/page_empty_page/input.md b/documentation/test_doxygen/page_empty_page/input.md
new file mode 100644 (file)
index 0000000..971a888
--- /dev/null
@@ -0,0 +1,12 @@
+@ingroup bla
+
+[comment]: # (The `ingroup` statement above avoids the generation of an empty page for this file.)
+[comment]: # (The actual group we add the file to is irrelevant, nothing is actually added.)
+[comment]: # (Doxygen will actually create xml/group__bla_md_input.xml, but we want to avoid)
+[comment]: # (creating html/group__bla_md_input.html, and listing `input` on the list of pages.)
+
+@class Foo::Bar
+
+This is the detailed description for class `Foo::Bar``.
+We put it in a separate file to not clutter the header file too much.
+Because this is a really loooong description!
diff --git a/documentation/test_doxygen/page_empty_page/pages.html b/documentation/test_doxygen/page_empty_page/pages.html
new file mode 100644 (file)
index 0000000..7943032
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>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>Pages</h2>
+        <ul class="m-doc">
+        </ul>
+        <script>
+        function toggle(e) {
+            e.parentElement.className = e.parentElement.className == 'm-doc-collapsible' ?
+                'm-doc-expansible' : 'm-doc-collapsible';
+            return false;
+        }
+        /* Collapse all nodes marked as such. Doing it via JS instead of
+           directly in markup so disabling it doesn't harm usability. The list
+           is somehow regenerated on every iteration and shrinks as I change
+           the classes. It's not documented anywhere and I'm not sure if this
+           is the same across browsers, so I am going backwards in that list to
+           be sure. */
+        var collapsed = document.getElementsByClassName("collapsed");
+        for(var i = collapsed.length - 1; i >= 0; --i)
+            collapsed[i].className = 'm-doc-expansible';
+        </script>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
index 54a2d976073b98bf5f1b9e3b365638465684da8f..fdee57ea86d8c2fb25c1fafdf858a11ebf3adbee 100644 (file)
@@ -22,6 +22,7 @@
 #   DEALINGS IN THE SOFTWARE.
 #
 
+import os
 import unittest
 
 from distutils.version import LooseVersion
@@ -100,3 +101,12 @@ class SubpageOfIndex(IntegrationTestCase):
         self.run_doxygen(wildcard='*.xml')
         self.assertEqual(*self.actual_expected_contents('page.html'))
         self.assertEqual(*self.actual_expected_contents('pages.html'))
+
+class EmptyPage(IntegrationTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'empty_page', *args, **kwargs)
+
+    def test(self):
+        self.run_doxygen(wildcard='*.xml')
+        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'group__bla_md_input.html')))
+        self.assertEqual(*self.actual_expected_contents('pages.html'))