From ef2f246c328d5a103ff1ec9a5ffc090924ac306f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 25 Apr 2018 08:22:44 +0200 Subject: [PATCH] doxygen: warn if GENERATE_SUBDIRS is enabled. --- doxygen/dox2html5.py | 7 +++++- doxygen/test/doxyfile/Doxyfile-subdirs | 1 + doxygen/test/test_doxyfile.py | 34 ++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 doxygen/test/doxyfile/Doxyfile-subdirs diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index f8edab6f..bce910bc 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -2608,6 +2608,7 @@ def parse_doxyfile(state: State, doxyfile, config = None): continuation_re = re.compile(r"""^\s*(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") default_config = { + 'GENERATE_SUBDIRS': ['NO'], 'PROJECT_NAME': ['My Project'], 'OUTPUT_DIRECTORY': [''], 'XML_OUTPUT': ['xml'], @@ -2736,7 +2737,8 @@ list using 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 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 index 00000000..130e06b0 --- /dev/null +++ b/doxygen/test/doxyfile/Doxyfile-subdirs @@ -0,0 +1 @@ +GENERATE_SUBDIRS = YES diff --git a/doxygen/test/test_doxyfile.py b/doxygen/test/test_doxyfile.py index 3cb8e273..5b9b61a5 100644 --- a/doxygen/test/test_doxyfile.py +++ b/doxygen/test/test_doxyfile.py @@ -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 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 : or / +suffix lists all members of given symbol or directory. Navigate through the +list using and +, press +Enter to go.""", + 'M_THEME_COLOR': '#22272e', + 'OUTPUT_DIRECTORY': '', + 'PROJECT_NAME': 'My Project', + 'XML_OUTPUT': 'xml' + }) -- 2.30.2