chiark / gitweb /
doxygen: dedicated test for ignoring empty documentation files.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 18 Jan 2018 20:20:00 +0000 (21:20 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 18 Jan 2018 20:40:17 +0000 (21:40 +0100)
doxygen/dox2html5.py
doxygen/test/compound_ignored/Doxyfile [new file with mode: 0644]
doxygen/test/compound_ignored/File.cpp [new file with mode: 0644]
doxygen/test/compound_ignored/File.h [new file with mode: 0644]
doxygen/test/test_compound.py

index e8f5c29e8f0007efaff6fd5877d7be78c0c65dd3..5dbf709a6130920ba93c3dfd19ddf44b0dfb58df 100755 (executable)
@@ -720,6 +720,8 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
         elif i.tag == 'formula':
             assert element.tag == 'para' # is inside a paragraph :/
 
+            logging.debug("{}: rendering math: {}".format(state.current, i.text))
+
             # We should have decided about block/inline above
             assert formula_block is not None
             if formula_block:
diff --git a/doxygen/test/compound_ignored/Doxyfile b/doxygen/test/compound_ignored/Doxyfile
new file mode 100644 (file)
index 0000000..6165277
--- /dev/null
@@ -0,0 +1,11 @@
+INPUT                   = File.h File.cpp
+QUIET                   = YES
+GENERATE_HTML           = NO
+GENERATE_LATEX          = NO
+GENERATE_XML            = YES
+
+M_PAGE_FINE_PRINT       =
+M_THEME_COLOR           =
+M_LINKS_NAVBAR1         =
+M_LINKS_NAVBAR2         =
+
diff --git a/doxygen/test/compound_ignored/File.cpp b/doxygen/test/compound_ignored/File.cpp
new file mode 100644 (file)
index 0000000..1f4d58e
--- /dev/null
@@ -0,0 +1,4 @@
+/** Undocumented file */
+
+/** @brief A var that doesn't appear in the docs because it's in undoc file */
+int a;
diff --git a/doxygen/test/compound_ignored/File.h b/doxygen/test/compound_ignored/File.h
new file mode 100644 (file)
index 0000000..8da57c5
--- /dev/null
@@ -0,0 +1,16 @@
+namespace {
+
+/** @brief Struct in an anonymous namespace */
+struct PrivateStruct { int a; /**< A var */ };
+
+}
+
+/** @brief A class */
+class A {
+    private:
+        /** @brief Private class */
+        class PrivateClass { int a; /**< A var */ };
+};
+
+/** @brief A class with just brief docs */
+class Brief {};
index 9102b0b10fc98b0341cb6a2aa062fd6f64950a9a..8eb08d7bc7cdd93286f68eeb8bdc717847e13576 100644 (file)
@@ -51,11 +51,6 @@ class Listing(IntegrationTestCase):
         self.assertEqual(*self.actual_expected_contents('File_8h.html'))
         self.assertEqual(*self.actual_expected_contents('Class_8h.html'))
 
-    @unittest.expectedFailure
-    def test_empty_file_doc_not_generated(self):
-        self.run_dox2html5(wildcard='Root_8h.xml')
-        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'Root_8h.html')))
-
     def test_namespace(self):
         self.run_dox2html5(wildcard='namespaceRoot_1_1Directory.xml')
         self.assertEqual(*self.actual_expected_contents('namespaceRoot_1_1Directory.html'))
@@ -68,11 +63,6 @@ class Listing(IntegrationTestCase):
         self.run_dox2html5(wildcard='classRoot_1_1Directory_1_1Sub_1_1Class.xml')
         self.assertEqual(*self.actual_expected_contents('classRoot_1_1Directory_1_1Sub_1_1Class.html'))
 
-    @unittest.expectedFailure
-    def test_empty_class_doc_not_generated(self):
-        self.run_dox2html5(wildcard='union*Bar*.xml')
-        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'unionRoot_1_1Directory_1_1Sub_1_1Class_1_1Bar.html')))
-
     def test_page_no_toc(self):
         self.run_dox2html5(wildcard='page-no-toc.xml')
         self.assertEqual(*self.actual_expected_contents('page-no-toc.html'))
@@ -120,3 +110,22 @@ class Detailed(IntegrationTestCase):
     def test_define(self):
         self.run_dox2html5(wildcard='File_8h.xml')
         self.assertEqual(*self.actual_expected_contents('File_8h.html'))
+
+class Ignored(IntegrationTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'ignored', *args, **kwargs)
+
+    def test(self):
+        self.run_dox2html5(index_pages=[], wildcard='*.xml')
+
+        self.assertTrue(os.path.exists(os.path.join(self.path, 'html', 'classA.html')))
+
+        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'classA_1_1PrivateClass.html')))
+        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'File_8cpp.html')))
+        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'input_8h.html')))
+        self.assertFalse(os.path.exists(os.path.join(self.path, 'html', 'namespace_0D0.html')))
+
+    @unittest.expectedFailure
+    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')))