From e6a6e65d46196125a5baad4aeb1942aa043236fa Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Jun 2020 13:35:46 +0200 Subject: Catch all wrong mkdir calls (coverity) - Always catch the output of `mkdir` - corrected an incorrect message (context.cpp) --- src/cite.cpp | 6 +++++- src/context.cpp | 2 +- src/template.cpp | 6 +++++- src/util.cpp | 10 ++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/cite.cpp b/src/cite.cpp index 4adf6f2..82f9e6d 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -203,7 +203,11 @@ void CitationManager::generatePage() QCString bibOutputDir = outputDir+"/"+bibTmpDir; QCString bibOutputFiles = ""; QDir thisDir; - thisDir.mkdir(bibOutputDir); + if (!thisDir.exists(bibOutputDir) && !thisDir.mkdir(bibOutputDir)) + { + err("Failed to create temorary output directory '%s', skiping citations\n",bibOutputDir.data()); + return; + } int i = 0; for (const auto &bibdata : citeDataList) { diff --git a/src/context.cpp b/src/context.cpp index d21b1d0..3d71706 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -10343,7 +10343,7 @@ void generateTemplateFiles(const char *templateDir) QCString outDir = QCString(templateDir)+"/html"; if (!thisDir.exists(outDir) && !thisDir.mkdir(outDir)) { - err("Failed to create output directory '%s'\n",templateDir); + err("Failed to create output directory '%s'\n",outDir.data()); return; } ResourceMgr::instance().writeCategory("html",outDir); diff --git a/src/template.cpp b/src/template.cpp index 1763eec..c836c6b 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -2843,7 +2843,11 @@ template class TemplateNodeCreator : public TemplateNode if (d.exists()) { bool ok = d.mkdir(fileName.mid(j,i-j)); - if (!ok) break; + if (!ok) + { + err("Failed to create directory '%s'\n",(fileName.mid(j,i-j)).data()); + break; + } QCString dirName = outputDir+'/'+fileName.left(i); d = QDir(dirName); j = i+1; diff --git a/src/util.cpp b/src/util.cpp index 7006f26..1624b1c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5022,10 +5022,16 @@ void createSubDirs(QDir &d) int l1,l2; for (l1=0;l1<16;l1++) { - d.mkdir(QCString().sprintf("d%x",l1)); + if (!d.mkdir(QCString().sprintf("d%x",l1))) + { + term("Failed to create output directory '%s'\n",(QCString().sprintf("d%x",l1)).data()); + } for (l2=0;l2<256;l2++) { - d.mkdir(QCString().sprintf("d%x/d%02x",l1,l2)); + if (!d.mkdir(QCString().sprintf("d%x/d%02x",l1,l2))) + { + term("Failed to create output directory '%s'\n",(QCString().sprintf("d%x/d%02x",l1,l2)).data()); + } } } } -- cgit v0.12 From 906f429414678e0bcecf3c67d1f49f436bac2876 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Jun 2020 15:28:22 +0200 Subject: Coverity uninitialized variable in mscgen_api.cpp - Initialize the variable ymax - add an extended example with "parallel events" triggered by a `,` instead of `;` between events --- libmscgen/mscgen_api.c | 1 + testing/037/037__msc_8cpp.xml | 27 +++++++++++++++++++++++++++ testing/037/class_receiver.xml | 4 ++-- testing/037/class_sender.xml | 4 ++-- testing/037_msc.cpp | 18 ++++++++++++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 testing/037/037__msc_8cpp.xml diff --git a/libmscgen/mscgen_api.c b/libmscgen/mscgen_api.c index 376b9d8..e2cdcb9 100644 --- a/libmscgen/mscgen_api.c +++ b/libmscgen/mscgen_api.c @@ -457,6 +457,7 @@ static RowInfo *computeCanvasSize(Context *ctx, nextYmin = ymin = ctx->opts.entityHeadGap; yskipmax = 0; + ymax = 0; MscResetArcIterator(m); do { diff --git a/testing/037/037__msc_8cpp.xml b/testing/037/037__msc_8cpp.xml new file mode 100644 index 0000000..3de730d --- /dev/null +++ b/testing/037/037__msc_8cpp.xml @@ -0,0 +1,27 @@ + + + + 037_msc.cpp + Sender + Receiver + + + + A bit more complex msc diagram, with also parallel events. +Sender_1,Receiver_1,Sender1_1, +Sender,Receiver,Sender1, +Sender_2,Receiver_2,Sender1_2; + +Sender_1->Receiver_1 [label="Command()", URL="nref Receiver::Command()"], +Sender1_1<-Receiver_1 [label="Ack()", URL="nref Ack()", ID="1"]; + +Sender->Receiver [label="Command()", URL="nref Receiver::Command()"]; +Sender1<-Receiver [label="Ack()", URL="nref Ack()", ID="1"]; +Sender_2->Receiver_2 [label="Command()", URL="nref Receiver::Command()"], +Sender1_2<-Receiver_2 [label="Ack()", URL="nref Ack()", ID="1"]; + + + + + + diff --git a/testing/037/class_receiver.xml b/testing/037/class_receiver.xml index 24e82fd..b3c9c5a 100644 --- a/testing/037/class_receiver.xml +++ b/testing/037/class_receiver.xml @@ -19,7 +19,7 @@ - + @@ -32,7 +32,7 @@ - + Receiver diff --git a/testing/037/class_sender.xml b/testing/037/class_sender.xml index 525ab0a..14f29d1 100644 --- a/testing/037/class_sender.xml +++ b/testing/037/class_sender.xml @@ -19,7 +19,7 @@ - + @@ -32,7 +32,7 @@ - + Sender diff --git a/testing/037_msc.cpp b/testing/037_msc.cpp index 84ffc55..a3c0e4b 100644 --- a/testing/037_msc.cpp +++ b/testing/037_msc.cpp @@ -1,6 +1,24 @@ // objective: test the \msc and \endmsc commands // check: class_sender.xml // check: class_receiver.xml +// check: 037__msc_8cpp.xml + +/** \file + * A bit more complex msc diagram, with also parallel events. + * \msc + * Sender_1,Receiver_1,Sender1_1, + * Sender,Receiver,Sender1, + * Sender_2,Receiver_2,Sender1_2; + * + * Sender_1->Receiver_1 [label="Command()", URL="nref Receiver::Command()"], + * Sender1_1<-Receiver_1 [label="Ack()", URL="nref Ack()", ID="1"]; + * + * Sender->Receiver [label="Command()", URL="nref Receiver::Command()"]; + * Sender1<-Receiver [label="Ack()", URL="nref Ack()", ID="1"]; + * Sender_2->Receiver_2 [label="Command()", URL="nref Receiver::Command()"], + * Sender1_2<-Receiver_2 [label="Ack()", URL="nref Ack()", ID="1"]; + * \endmsc + */ /** Sender class. Can be used to send a command to the server. * The receiver will acknowledge the command by calling Ack(). -- cgit v0.12 From e7637f9dd977e9821394e7bed4dec02aec41ab9e Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 14:54:25 +0200 Subject: Number of translatable terms (like Chapter) are in English instead of Greek (#7841) * Number of translatable terms (like Chapter) are in English instead of Greek When running tests in Greek OUTPUT_LANGUAGE mode for LaTeX a number of terms like Chapter were still in English instead of Greek. Some used references: https://tex.stackexchange.com/questions/548584/ascii-text-set-in-greek-script-when-using-usepackagegreekbabel https://tex.stackexchange.com/questions/548761/missing-characters-in-output-due-to-renewcommand-familydefault-sfdefault https://tex.stackexchange.com/questions/58624/variables-for-hiding-or-showing-text-in-latex * Number of translatable terms (like Chapter) are in English instead of Greek - adding the possibilities for mono spaced font (for code parts) - creating a more flexible way to change fonts for different languages See also discussion at https://tex.stackexchange.com/questions/548901/missing-characters-in-greek-output-due-to-ttfamily --- src/latexgen.cpp | 10 ++++++---- src/translator.h | 5 +++++ src/translator_gr.h | 24 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index f3cce3e..cb42863 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -560,11 +560,13 @@ static void writeDefaultHeaderPart1(FTextStream &t) { t << "\\usepackage[" << fontenc << "]{fontenc}\n"; } - t << "\\usepackage[scaled=.90]{helvet}\n" - "\\usepackage{courier}\n" - "\\usepackage{amssymb}\n" + QCString font = theTranslator->latexFont(); + if (!font.isEmpty()) + { + t << font; + } + t << "\\usepackage{amssymb}\n" "\\usepackage{sectsty}\n" - "\\renewcommand{\\familydefault}{\\sfdefault}\n" "\\allsectionsfont{%\n" " \\fontseries{bc}\\selectfont%\n" " \\color{darkgray}%\n" diff --git a/src/translator.h b/src/translator.h index 188b775..991e637 100644 --- a/src/translator.h +++ b/src/translator.h @@ -50,6 +50,11 @@ class Translator * can be returned. */ virtual QCString latexFontenc() { return "T1"; } + virtual QCString latexFont() { + return "\\usepackage[scaled=.90]{helvet}\n" + "\\usepackage{courier}\n" + "\\renewcommand{\\familydefault}{\\sfdefault}\n"; + } /*! * Sets the commands to be inserted directly after the `\\begin{document}` * in the LaTeX document. diff --git a/src/translator_gr.h b/src/translator_gr.h index 6ed43db..854a956 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -59,8 +59,18 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15 virtual QCString latexLanguageSupportCommand() { - return "\\usepackage[greek,english]{babel}\n" - "\\usepackage{alphabeta}\n"; + return "\\usepackage{fontspec}\n" + "\\usepackage[greek]{babel}\n"; + } + + virtual QCString latexFontenc() + { + return ""; + } + virtual QCString latexFont() + { + return "\\setmainfont{Libertinus Sans}\n" + "\\setmonofont{Courier New}\n"; } // --- Language translation methods ------------------- @@ -1159,6 +1169,16 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15 return "1253"; } + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; + } /*! Used as ansicpg for RTF fcharset */ -- cgit v0.12 From e53fa89addc9659ad406298d27a6376d1eb53e0d Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 14:55:13 +0200 Subject: Incorrect label in map of dot files in xhtml (#7840) When a filename of a file starts with a digit the mapping of the resulting dot files results in message like: ``` Syntax of value for attribute id of map is not valid ``` an id cannot start with a digit, so an "a" is placed in front of it (unconditionally to overcome problems with a double label id i.e filename 087.cpp and a087.cpp). --- src/dotfilepatcher.cpp | 2 +- src/dotgraph.cpp | 2 +- src/util.cpp | 10 ++++++++++ src/util.h | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp index 20ce4c1..17f8cb7 100644 --- a/src/dotfilepatcher.cpp +++ b/src/dotfilepatcher.cpp @@ -460,7 +460,7 @@ bool DotFilePatcher::run() const convertMapFile(tt,map->mapFile,map->relPath,map->urlOnly,map->context); if (!result.isEmpty()) { - t << "label << "\" id=\"" << map->label << "\">" << endl; + t << "label << "\" id=\"" << correctId(map->label) << "\">" << endl; t << result; t << "" << endl; } diff --git a/src/dotgraph.cpp b/src/dotgraph.cpp index c0cc4fd..1ad85e1 100644 --- a/src/dotgraph.cpp +++ b/src/dotgraph.cpp @@ -236,7 +236,7 @@ void DotGraph::generateCode(FTextStream &t) else // add link to bitmap file with image map { if (!m_noDivTag) t << "
"; - t << "\"""; + t << "\"""; if (!m_noDivTag) t << "
"; t << endl; if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, getMapLabel())) diff --git a/src/util.cpp b/src/util.cpp index 1624b1c..a298ace 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5278,6 +5278,16 @@ QCString convertToId(const char *s) return growBuf.get(); } +/*! Some strings have been corrected but the requirement regarding the fact + * that an id cannot have a digit at the first position. To overcome problems + * with double labels we always place an "a" in front + */ +QCString correctId(QCString s) +{ + if (s.isEmpty()) return s; + return "a" + s; +} + /*! Converts a string to an XML-encoded string */ QCString convertToXML(const char *s, bool keepEntities) { diff --git a/src/util.h b/src/util.h index a93220c..65d164a 100644 --- a/src/util.h +++ b/src/util.h @@ -278,6 +278,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te QCString stripScope(const char *name); QCString convertToId(const char *s); +QCString correctId(QCString s); QCString convertToHtml(const char *s,bool keepEntities=TRUE); -- cgit v0.12 From 963b8da31e03d149eefb9d61033db9f7263728da Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Sat, 13 Jun 2020 15:56:14 +0300 Subject: Add namespace inline flag in xml output (#7828) * Flag namespace as inline in xml output * Add inline namespace flag to innernamespace tag as well suggested by @mosra --- src/xmlgen.cpp | 7 +++++-- templates/xml/compound.xsd | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 3a649e9..593f69a 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1150,7 +1150,8 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) if (!nd->isHidden() && !nd->isAnonymous()) { t << " getOutputFileBase() - << "\">" << convertToXML(nd->name()) << "" << endl; + << "\"" << (nd->isInline() ? " inline=\"yes\"" : "") + << ">" << convertToXML(nd->name()) << "" << endl; } } } @@ -1458,7 +1459,9 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti) writeXMLHeader(t); t << " getOutputFileBase() - << "\" kind=\"namespace\" language=\"" + << "\" kind=\"namespace\" " + << (nd->isInline()?"inline=\"yes\" ":"") + << "language=\"" << langToString(nd->getLanguage()) << "\">" << endl; t << " "; writeXMLString(t,nd->name()); diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index e17d2fa..4df19ce 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -43,6 +43,7 @@ + @@ -104,6 +105,7 @@ + -- cgit v0.12 From 42e36bdfa05f0a553f11bfd50f4a4eb2e9c74f82 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:00:02 +0200 Subject: Addon option --pool to the test run script for parallel execution of tests (#7827) To make better use of the processors of a computer the possibility has been build to execute the tests in parallel, this is especially of an advantage for PDF tests. To make use of this option the number of parallel tests `np` has to be specified by means of `--pool=np`, the default is 1. --- testing/runtests.py | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/testing/runtests.py b/testing/runtests.py index 7896cdd..52fab66 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -183,7 +183,7 @@ class Tester: # check if the file we need to check is actually generated if not os.path.isfile(check_file): print('Non-existing file %s after \'check:\' statement' % check_file) - return + return False # convert output to canonical form data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)) if data: @@ -191,12 +191,13 @@ class Tester: data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n') else: print('Failed to run %s on the doxygen output file %s' % (self.args.xmllint,self.test_out)) - return + return False out_file='%s/%s' % (self.test_out,check) with xopen(out_file,'w') as f: print(data,file=f) shutil.rmtree(self.test_out+'/out',ignore_errors=True) os.remove(self.test_out+'/Doxyfile') + return True # check the relevant files of a doxygen run with the reference material def perform_test(self,testmgr): @@ -401,17 +402,22 @@ class Tester: if failed_xml or failed_html or failed_latex or failed_docbook or failed_rtf or failed_xmlxsd: testmgr.ok(False,self.test_name,msg) - return + return False testmgr.ok(True,self.test_name) if not self.args.keep: shutil.rmtree(self.test_out,ignore_errors=True) + return True def run(self,testmgr): if self.update: - self.update_test(testmgr) + return self.update_test(testmgr) else: - self.perform_test(testmgr) + return self.perform_test(testmgr) + +def do_generation_work(test): + tester = Tester(test[0].args,test[1]) + return tester.run(test[0]) class TestManager: def __init__(self,args,tests): @@ -426,10 +432,10 @@ class TestManager: def ok(self,result,test_name,msg='Ok'): if result: - print('ok %s - %s' % (self.count,test_name)) + print('ok - %s' % (test_name)) self.passed = self.passed + 1 else: - print('not ok %s - %s' % (self.count,test_name)) + print('not ok - %s' % (test_name)) print('-------------------------------------') for o in msg: print(o) @@ -444,9 +450,20 @@ class TestManager: return 0 if self.passed==self.num_tests else 1 def perform_tests(self): - for test in self.tests: - tester = Tester(self.args,test) - tester.run(self) + if (self.args.pool == 1): + passed = 0 + for test in self.tests: + tester = Tester(self.args,test) + passed += tester.run(self) + self.passed = passed + else: + dl = [] + for test in self.tests: + dl += [(self, test)] + import multiprocessing as mp + p = mp.Pool(processes=self.args.pool) + passed = p.map(do_generation_work, dl) + self.passed = sum(passed) res=self.result() if self.args.xhtml and self.args.inputdir!='.' and not res and not self.args.keep: shutil.rmtree("dtd",ignore_errors=True) @@ -483,6 +500,8 @@ def main(): 'output directory to write the doxygen output to') parser.add_argument('--noredir',help= 'disable redirection of doxygen warnings',action="store_true") + parser.add_argument('--pool',nargs='?',default='1',type=int,help= + 'pool size of multiprocess tests') parser.add_argument('--xml',help='create xml output and check', action="store_true") parser.add_argument('--rtf',help= -- cgit v0.12 From 9438348bfc2fdf30ec96483679a3504cb8e17dfc Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:00:28 +0200 Subject: Create link for GENERATE_XML (#7824) Small documentation consistency. --- doc/customize.doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/customize.doc b/doc/customize.doc index 7b2729d..52f8d7a 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -372,7 +372,8 @@ generated output! If the above two methods still do not provide enough flexibility, you can also use the XML output produced by doxygen as a basis to -generate the output you like. To do this set GENERATE_XML to YES. +generate the output you like. To do this set +\ref cfg_generate_xml "GENERATE_XML" to \c YES. The XML output consists of an index file named \c index.xml which lists all items extracted by doxygen with references to the other XML files -- cgit v0.12 From e4a9056a5d0fb6764fadd4dac72e4a68184b9387 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:01:50 +0200 Subject: issue #7810 LaTeX manual not built, but make install tries to install it (#7821) Give a meaningful fatal error when the pdf does not exists (when it exists automatically also the html directory with content exists). Give a meaningful fatal error when the chm does not exists. --- doc/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 537089b..df9c2a6 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -212,12 +212,22 @@ install(FILES DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) +install(CODE "if(NOT EXISTS \"${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf\") + message(FATAL_ERROR \"\nTerminating:\n documentation has not been generated, \n create documentation by using the 'docs' target followed by an 'install'\n\") +endif()" +) + install(FILES "${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}" ) if (build_doc_chm) +install(CODE "if(NOT EXISTS \"${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm\") + message(FATAL_ERROR \"\nTerminating:\n CHM documentation has not been generated, \n create CHM documentation by using the 'docs_chm' target followed by an 'install'\n\") +endif()" +) + install(FILES "${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}" -- cgit v0.12 From fce24d0725943a9b1a1ac069449fda1d0bdf9ab7 Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Sat, 13 Jun 2020 15:02:20 +0200 Subject: Add `const` qualifier to UsedDir::m_dir. (#7820) --- src/dirdef.cpp | 2 +- src/dirdef.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 7f0b524..dd8444e 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -750,7 +750,7 @@ int FilePairDict::compareValues(const FilePair *left,const FilePair *right) cons //---------------------------------------------------------------------- -UsedDir::UsedDir(DirDef *dir,bool inherited) : +UsedDir::UsedDir(const DirDef *dir,bool inherited) : m_dir(dir), m_filePairs(7), m_inherited(inherited) { m_filePairs.setAutoDelete(TRUE); diff --git a/src/dirdef.h b/src/dirdef.h index 399e0c2..468901d 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -104,7 +104,7 @@ class FilePairDict : public SDict class UsedDir { public: - UsedDir(DirDef *dir,bool inherited); + UsedDir(const DirDef *dir,bool inherited); virtual ~UsedDir(); void addFileDep(FileDef *srcFd,FileDef *dstFd); FilePair *findFilePair(const char *name); @@ -114,7 +114,7 @@ class UsedDir void sort(); private: - DirDef *m_dir; + const DirDef *m_dir; FilePairDict m_filePairs; bool m_inherited; }; -- cgit v0.12 From 2aef0e0e4f91038b0b1d952efad0a3aba7d6a6cd Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:04:37 +0200 Subject: bug_121547 extern variable is being referenced in documentation incorrectly (#7792) It is made clear that where the variable is declared "extern" that it is also shown at that place in the documentation --- src/memberdef.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/memberdef.cpp b/src/memberdef.cpp index d857fa6..1d7909b 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2733,7 +2733,7 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const isFriend() || isRelated() || (isInline() && inlineInfo) || isSignal() || isSlot() || - isStatic() || + isStatic() || isExternal() || (getClassDef() && getClassDef()!=container && container->definitionType()==TypeClass) || (m_impl->memSpec & ~Entry::Inline)!=0 ) @@ -2745,7 +2745,7 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const //ol.docify(" ["); SrcLangExt lang = getLanguage(); bool optVhdl = lang==SrcLangExt_VHDL; - bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); + static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); if (optVhdl) { sl.append(theTranslator->trVhdlType(getMemberSpecifiers(),TRUE)); @@ -2756,7 +2756,8 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const else if (isRelated()) sl.append("related"); else { - if (Config_getBool(INLINE_INFO) && isInline()) sl.append("inline"); + if (isExternal()) sl.append("extern"); + if (inlineInfo && isInline()) sl.append("inline"); if (isExplicit()) sl.append("explicit"); if (isMutable()) sl.append("mutable"); if (isStatic()) sl.append("static"); -- cgit v0.12 From 22d8ffd11ad8b864941ba73f2161622d693f4f49 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:05:45 +0200 Subject: Running doxygen tests with variable with spaces (#7819) When having a run command like: ``` nmake tests TEST_FLAGS="--xhtml --keep --cfg GENERATE_HTMLHELP=YES --cfg HHC_LOCATION=\"c:\Program Files (x86)\HTML Help Workshop\hhc.exe\" --cfg HTML_FILE_EXTENSION=.html --cfg SEARCHENGINE=NO --id=1" ``` we get an error like ``` Not a doxygen configuration item, missing '=' sign: 'Files'. ``` this is due to the usage of the `split()` that does a brute force split on spaces. Making the splitting a bit more intelligent: - splitting on `--` - splitting on space after "command" --- testing/runtests.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/testing/runtests.py b/testing/runtests.py index 52fab66..5d5cee1 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -150,11 +150,11 @@ class Tester: if (self.args.clang): print('CLANG_ASSISTED_PARSING=YES', file=f) if (self.args.cfgs): - for cfg in list(itertools.chain.from_iterable(self.args.cfgs)): - if cfg.find('=') == -1: + for cfg in self.args.cfgs: + if cfg[0].find('=') == -1: print("Not a doxygen configuration item, missing '=' sign: '%s'."%cfg) sys.exit(1) - print(cfg, file=f) + print(cfg[0], file=f) if 'check' not in self.config or not self.config['check']: print('Test doesn\'t specify any files to check') @@ -474,6 +474,25 @@ class TestManager: shutil.rmtree("dtd",ignore_errors=True) shutil.copytree(self.args.inputdir+"/dtd", "dtd") +def split_and_keep(s, sep): + if not s: return [] + + # Find replacement character that is not used in string + # i.e. just use the highest available character plus one + # Note: This fails if ord(max(s)) = 0x10FFFF (ValueError) + p=chr(ord(max(s))+1) + + retVal = [] + for val in s.replace(sep, p+sep).split(p): + vv = val.split(" ",1) + if ((len(vv) == 1) and not vv[0] == ''): + retVal += vv + if ((len(vv) == 2) and not vv[1] == ''): + retVal += vv + if ((len(vv) == 2) and vv[1] == ''): + retVal += [vv[0]] + return retVal + def main(): # argument handling parser = argparse.ArgumentParser(description='run doxygen tests') @@ -524,7 +543,9 @@ def main(): parser.add_argument('--cfg',nargs='+',dest='cfgs',action='append',help= 'run test with extra doxygen configuration settings ' '(the option may be specified multiple times') - test_flags = os.getenv('TEST_FLAGS', default='').split() + + test_flags = split_and_keep(os.getenv('TEST_FLAGS', default=''), '--') + args = parser.parse_args(test_flags + sys.argv[1:]) # sanity check -- cgit v0.12 From 65bf92c94f2118b0f6e6c19e62993c6e27ebbef9 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:07:52 +0200 Subject: issue #7796 Backticks (`) in Doxygen-markup-in-C in Markdown collapses (#7797) * issue #7796 Backticks (`) in Doxygen-markup-in-C in Markdown collapses The problem occurs when the backtick is just before the end of line. The fenced block will only terminate when the same number of fence characters are present, otherwise the search will continue. * issue #7796 Backticks (`) in Doxygen-markup-in-C in Markdown collapses Removed unintentional tab. --- src/markdown.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index c4dd9fb..06b714a 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1501,8 +1501,11 @@ static bool isFencedCodeBlock(const char *data,int size,int refIndent, while (i