chiark / gitweb /
doxygen: warn if GENERATE_SUBDIRS is enabled.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 25 Apr 2018 06:22:44 +0000 (08:22 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 25 Apr 2018 06:24:29 +0000 (08:24 +0200)
doxygen/dox2html5.py
doxygen/test/doxyfile/Doxyfile-subdirs [new file with mode: 0644]
doxygen/test/test_doxyfile.py

index f8edab6fedadebe7ccd6489ac65ecd6cd9da8357..bce910bc21be9d3fac8ce3fa5fdd61b910c15c14 100755 (executable)
@@ -2608,6 +2608,7 @@ def parse_doxyfile(state: State, doxyfile, config = None):
     continuation_re = re.compile(r"""^\s*(?P<quote>['"]?)(?P<value>.*)(?P=quote)\s*(?P<backslash>\\?)$""")
 
     default_config = {
+        'GENERATE_SUBDIRS': ['NO'],
         'PROJECT_NAME': ['My Project'],
         'OUTPUT_DIRECTORY': [''],
         'XML_OUTPUT': ['xml'],
@@ -2736,7 +2737,8 @@ list using <span class="m-label m-dim">&darr;</span> and
         if i in config: state.doxyfile[i] = int(' '.join(config[i]))
 
     # Boolean values that we want
-    for i in ['M_EXPAND_INNER_TYPES',
+    for i in ['GENERATE_SUBDIRS',
+              'M_EXPAND_INNER_TYPES',
               'M_SEARCH_DISABLED',
               'M_SEARCH_DOWNLOAD_BINARY']:
         if i in config: state.doxyfile[i] = ' '.join(config[i]) == 'YES'
@@ -2750,6 +2752,9 @@ list using <span class="m-label m-dim">&darr;</span> and
         if i in config:
             state.doxyfile[i] = [line for line in config[i] if line]
 
+    if state.doxyfile['GENERATE_SUBDIRS']:
+        logging.fatal("{}: GENERATE_SUBDIRS is not supported, output will be most probably empty".format(doxyfile))
+
 default_index_pages = ['pages', 'files', 'namespaces', 'modules', 'annotated']
 default_wildcard = '*.xml'
 default_templates = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'templates/')
diff --git a/doxygen/test/doxyfile/Doxyfile-subdirs b/doxygen/test/doxyfile/Doxyfile-subdirs
new file mode 100644 (file)
index 0000000..130e06b
--- /dev/null
@@ -0,0 +1 @@
+GENERATE_SUBDIRS = YES
index 3cb8e273df56285b5e234bf0760331ef40016710..5b9b61a5faeecf5ca383a0d815de4de5c06cf33e 100644 (file)
@@ -37,6 +37,7 @@ class Doxyfile(unittest.TestCase):
         state = State()
         parse_doxyfile(state, 'test/doxyfile/Doxyfile')
         self.assertEqual(state.doxyfile, {
+            'GENERATE_SUBDIRS': False,
             'HTML_EXTRA_FILES': ['css', 'another.png', 'hello'],
             'HTML_EXTRA_STYLESHEET': ['a.css', 'b.css'],
             'HTML_OUTPUT': 'html',
@@ -64,3 +65,36 @@ list using <span class="m-label m-dim">&darr;</span> and
             'PROJECT_NAME': 'My Pet Project',
             'XML_OUTPUT': 'xml'
         })
+
+    def test_subdirs(self):
+        state = State()
+        parse_doxyfile(state, 'test/doxyfile/Doxyfile-subdirs')
+        self.assertEqual(state.doxyfile, {
+            'GENERATE_SUBDIRS': True,
+            'HTML_EXTRA_FILES': [],
+            'HTML_EXTRA_STYLESHEET': [
+                'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600',
+                '../css/m-dark+doxygen.compiled.css'],
+            'HTML_OUTPUT': 'html',
+            'M_CLASS_TREE_EXPAND_LEVELS': 1,
+            'M_EXPAND_INNER_TYPES': False,
+            'M_FAVICON': '',
+            'M_FILE_TREE_EXPAND_LEVELS': 1,
+            'M_LINKS_NAVBAR1': ['pages', 'namespaces'],
+            'M_LINKS_NAVBAR2': ['annotated', 'files'],
+            'M_PAGE_FINE_PRINT': '[default]',
+            'M_SEARCH_DISABLED': False,
+            'M_SEARCH_DOWNLOAD_BINARY': False,
+            'M_SEARCH_EXTERNAL_URL': '',
+            'M_SEARCH_HELP':
+"""Search for symbols, directories, files, pages or modules. You can omit any
+prefix from the symbol or file path; adding a <code>:</code> or <code>/</code>
+suffix lists all members of given symbol or directory. Navigate through the
+list using <span class="m-label m-dim">&darr;</span> and
+<span class="m-label m-dim">&uarr;</span>, press
+<span class="m-label m-dim">Enter</span> to go.""",
+            'M_THEME_COLOR': '#22272e',
+            'OUTPUT_DIRECTORY': '',
+            'PROJECT_NAME': 'My Project',
+            'XML_OUTPUT': 'xml'
+        })