diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | addon/doxyparse/README | 40 | ||||
-rw-r--r-- | addon/doxyparse/README.md | 52 | ||||
-rw-r--r-- | addon/doxyparse/doxyparse.cpp | 4 | ||||
-rw-r--r-- | src/config.xml | 19 | ||||
-rw-r--r-- | src/dotnode.cpp | 105 | ||||
-rw-r--r-- | src/doxygen.cpp | 1 | ||||
-rw-r--r-- | src/message.cpp | 32 | ||||
-rw-r--r-- | src/message.h | 1 |
9 files changed, 166 insertions, 90 deletions
diff --git a/.travis.yml b/.travis.yml index 733e668..eb406c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,7 +123,7 @@ script: - cmake -G "Unix Makefiles" -Dbuild_doc=ON -Dbuild_wizard=ON .. - make - if [ ! "${TRAVIS_OS_NAME}" == "osx" ] && [ ! "${TRAVIS_COMPILER}" == "clang" ]; then - make tests docs; + make tests TEST_FLAGS="--xml --xmlxsd --xhtml --docbook --rtf" docs; fi; - if [ ! "${TRAVIS_OS_NAME}" == "osx" ] && [ "${TRAVIS_COMPILER}" == "clang" ]; then make docs; diff --git a/addon/doxyparse/README b/addon/doxyparse/README deleted file mode 100644 index 95cce8c..0000000 --- a/addon/doxyparse/README +++ /dev/null @@ -1,40 +0,0 @@ -doxyparse -========= - -This directory contains an "source parsing engine" based on doxyapp code. - -More info and source code repository: https://github.com/analizo/doxygen - -## build dependencies - - apt-get install flex bison cmake build-essential python - -## build - - cmake -G "Unix Makefiles" -Dbuild_parse=ON - make - -## install - - sudo make install - -## release - -* ensure analizo testsuite passing on newer doxyparse version -* update debian/changelog, commit, push -* create git tag, push to github analizo/doxyparse -* build on amd64 and i386 archs, upload tar.gz to github - * tar -zcf doxyparse_<VERSION>_amd64.tar.gz -C bin/ doxyparse - * tar -zcf doxyparse_<VERSION>_i386.tar.gz -C bin/ doxyparse -* build debian packages for amd64 and i386, update analizo.org repository - * (see analizo.github.io/README.md file for updating repository instructions) - * upload the deb files to github release tag also -* check if a alien-doxyparse release is necessary and do it on cpan - -AUTHORS - -Antonio Terceiro <terceiro@softwarelivre.org> -João M. Miranda <joaomm88@gmail.com> -Joenio Costa <joenio@joenio.me> -Paulo Meirelles <paulo@softwarelivre.org> -Vinicius Daros <vkdaros@mercurio.eclipse.ime.usp.br> diff --git a/addon/doxyparse/README.md b/addon/doxyparse/README.md new file mode 100644 index 0000000..75746b7 --- /dev/null +++ b/addon/doxyparse/README.md @@ -0,0 +1,52 @@ +# Doxyparse + +This directory contains an "source parsing engine" based on doxyapp code. + +Doxyparse modifies the default output of Doxygen and dumps the dependencies +among code elements in a YAML format, instead of output it in a human-readable +format, as Doxygen does Doxyparse's output is intented to produce a +machine-readable output. + +Doxyparse has been used in many software engeneering research (as a source-code +static analysis tool) regards on software metrics, quality metrics and so on, +Doxyparse was first used by the [Analizo](http://analizo.org) toolkit, a suite +of source code analysis tools, aimed at being language-independent and +extensible, able to extract and calculate a fair number of source code metrics, +generate dependency graphs, and other software evolution analysis. + +Academic publications citing Doxyparse: +* https://scholar.google.com.br/scholar?q=doxyparse + +## build dependencies + + apt-get install flex bison cmake build-essential python + +## build + + cmake -G "Unix Makefiles" -Dbuild_parse=ON + make + +## install + + sudo make install + +## release + +* ensure analizo testsuite passing on newer doxyparse version +* update debian/changelog, commit, push +* create git tag, push to github analizo/doxyparse +* build on amd64 and i386 archs, upload tar.gz to github + * tar -zcf doxyparse_<VERSION>_amd64.tar.gz -C bin/ doxyparse + * tar -zcf doxyparse_<VERSION>_i386.tar.gz -C bin/ doxyparse +* build debian packages for amd64 and i386, update analizo.org repository + * (see analizo.github.io/README.md file for updating repository instructions) + * upload the deb files to github release tag also +* check if a alien-doxyparse release is necessary and do it on cpan + +## Authors + +* Antonio Terceiro <terceiro@softwarelivre.org> +* João M. Miranda <joaomm88@gmail.com> +* Joenio Costa <joenio@joenio.me> +* Paulo Meirelles <paulo@softwarelivre.org> +* Vinicius Daros <vkdaros@mercurio.eclipse.ime.usp.br> diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp index d4abd3a..4235bf3 100644 --- a/addon/doxyparse/doxyparse.cpp +++ b/addon/doxyparse/doxyparse.cpp @@ -144,7 +144,7 @@ static void printInherits() { printf(" inherits:\n"); } static void printInheritance(std::string base_class) { - printf(" - %s\n", base_class.c_str()); + printf(" - \"%s\"\n", base_class.c_str()); } static void printDefines() { printf(" defines:\n"); @@ -361,7 +361,7 @@ static void classInformation(const ClassDef* cd) { if (!cd->baseClasses().empty()) { printInherits(); for (const auto &bcd : cd->baseClasses()) { - printInheritance(bcd.classDef->name().data()); + printInheritance(sanitizeString(bcd.classDef->name().data())); } } if(cd->isAbstract()) { diff --git a/src/config.xml b/src/config.xml index fb48c63..38a18d8 100644 --- a/src/config.xml +++ b/src/config.xml @@ -1336,13 +1336,19 @@ FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn" ]]> </docs> </option> - <option type='bool' id='WARN_AS_ERROR' defval='0'> + <option type='enum' id='WARN_AS_ERROR' defval='NO'> <docs> <![CDATA[ If the \c WARN_AS_ERROR tag is set to \c YES then doxygen will immediately stop when a warning is encountered. + If the \c WARN_AS_ERROR tag is set to \c FAIL_ON_WARNINGS then doxygen will continue + running as if \c WARN_AS_ERROR tag is set to \c NO, but at the end of the doxygen + process doxygen will return with a non-zero status. ]]> </docs> + <value name="NO"/> + <value name="YES" /> + <value name="FAIL_ON_WARNINGS" /> </option> <option type='string' id='WARN_FORMAT' format='string' defval='$file:$line: $text'> <docs> @@ -3444,13 +3450,22 @@ to be found in the default search path. ]]> </docs> </option> - <option type='bool' id='DOT_UML_DETAILS' defval='0' depends='UML_LOOK'> + <option type='enum' id='DOT_UML_DETAILS' defval='NO' depends='UML_LOOK'> <docs> <![CDATA[ +If the \c DOT_UML_DETAILS tag is set to \c NO, doxygen will +show attributes and methods without types and arguments in the UML graphs. If the \c DOT_UML_DETAILS tag is set to \c YES, doxygen will add type and arguments for attributes and methods in the UML graphs. +If the \c DOT_UML_DETAILS tag is set to \c NONE, doxygen will not generate +fields with class member information in the UML graphs. +The class diagrams will look similar to the default class diagrams but using +UML notation for the relationships. ]]> </docs> + <value name="NO" /> + <value name="YES" /> + <value name="NONE" /> </option> <option type='int' id='DOT_WRAP_THRESHOLD' defval='17' minval='0' maxval='1000' depends='HAVE_DOT'> <docs> diff --git a/src/dotnode.cpp b/src/dotnode.cpp index 8ce1bb3..86f99a2 100644 --- a/src/dotnode.cpp +++ b/src/dotnode.cpp @@ -97,6 +97,30 @@ static EdgeProperties umlEdgeProps = umlEdgeColorMap, umlArrowStyleMap, umlEdgeStyleMap }; +// Extracted from config setting "DOT_UML_DETAILS" +enum class UmlDetailLevel +{ + Default, // == NO, the default setting + Full, // == YES, include type and arguments + None // == NONE, don't include compartments for attributes and methods +}; + +// Local helper function for extracting the configured detail level +static UmlDetailLevel getUmlDetailLevelFromConfig() +{ + UmlDetailLevel result = UmlDetailLevel::Default; + QCString umlDetailsStr = Config_getEnum(DOT_UML_DETAILS).upper(); + if (umlDetailsStr == "YES") + { + result=UmlDetailLevel::Full; + } + else if (umlDetailsStr == "NONE") + { + result=UmlDetailLevel::None; + } + return result; +} + static QCString escapeTooltip(const QCString &tooltip) { QCString result; @@ -149,7 +173,7 @@ static void writeBoxMemberList(FTextStream &t, { t << prot << " "; QCString label; - if(Config_getBool(DOT_UML_DETAILS)) + if(getUmlDetailLevelFromConfig()==UmlDetailLevel::Full) { label+=mma->typeString(); label+=" "; @@ -157,7 +181,7 @@ static void writeBoxMemberList(FTextStream &t, label+=mma->name(); if (!mma->isObjCMethod() && (mma->isFunction() || mma->isSlot() || mma->isSignal())) { - if(Config_getBool(DOT_UML_DETAILS)) + if(getUmlDetailLevelFromConfig()==UmlDetailLevel::Full) { label+=mma->argsString(); } @@ -428,45 +452,48 @@ void DotNode::writeBox(FTextStream &t, } //printf("DotNode::writeBox for %s\n",m_classDef->name().data()); - t << "{" << convertLabel(m_label); - t << "\\n|"; - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubAttribs),m_classDef,FALSE,&arrowNames); - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubStaticAttribs),m_classDef,TRUE,&arrowNames); - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_properties),m_classDef,FALSE,&arrowNames); - writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacAttribs),m_classDef,FALSE,&arrowNames); - writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacStaticAttribs),m_classDef,TRUE,&arrowNames); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proAttribs),m_classDef,FALSE,&arrowNames); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proStaticAttribs),m_classDef,TRUE,&arrowNames); - if (Config_getBool(EXTRACT_PRIVATE)) - { - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priAttribs),m_classDef,FALSE,&arrowNames); - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priStaticAttribs),m_classDef,TRUE,&arrowNames); - } - t << "|"; - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubMethods),m_classDef); - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubStaticMethods),m_classDef,TRUE); - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubSlots),m_classDef); - writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacMethods),m_classDef); - writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacStaticMethods),m_classDef,TRUE); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proMethods),m_classDef); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proStaticMethods),m_classDef,TRUE); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proSlots),m_classDef); - if (Config_getBool(EXTRACT_PRIVATE)) - { - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priMethods),m_classDef); - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priStaticMethods),m_classDef,TRUE); - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priSlots),m_classDef); - } - if (m_classDef->getLanguage()!=SrcLangExt_Fortran && - m_classDef->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgdi(*m_classDef->getMemberGroupSDict()); - MemberGroup *mg; - for (mgdi.toFirst();(mg=mgdi.current());++mgdi) + t << "{" << convertLabel(m_label) << "\\n"; + if (getUmlDetailLevelFromConfig()!=UmlDetailLevel::None) + { + t << "|"; + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubStaticAttribs),m_classDef,TRUE,&arrowNames); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_properties),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacStaticAttribs),m_classDef,TRUE,&arrowNames); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proStaticAttribs),m_classDef,TRUE,&arrowNames); + if (Config_getBool(EXTRACT_PRIVATE)) { - if (mg->members()) + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priStaticAttribs),m_classDef,TRUE,&arrowNames); + } + t << "|"; + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubMethods),m_classDef); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubStaticMethods),m_classDef,TRUE); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubSlots),m_classDef); + writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacMethods),m_classDef); + writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberListType_pacStaticMethods),m_classDef,TRUE); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proMethods),m_classDef); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proStaticMethods),m_classDef,TRUE); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberListType_proSlots),m_classDef); + if (Config_getBool(EXTRACT_PRIVATE)) + { + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priMethods),m_classDef); + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priStaticMethods),m_classDef,TRUE); + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priSlots),m_classDef); + } + if (m_classDef->getLanguage()!=SrcLangExt_Fortran && + m_classDef->getMemberGroupSDict()) + { + MemberGroupSDict::Iterator mgdi(*m_classDef->getMemberGroupSDict()); + MemberGroup *mg; + for (mgdi.toFirst();(mg=mgdi.current());++mgdi) { - writeBoxMemberList(t,'*',mg->members(),m_classDef,FALSE,&arrowNames); + if (mg->members()) + { + writeBoxMemberList(t,'*',mg->members(),m_classDef,FALSE,&arrowNames); + } } } } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 4667cba..e246628 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11914,6 +11914,7 @@ void generateOutput() QDir thisDir; thisDir.remove(Doxygen::objDBFileName); thisDir.remove(Doxygen::filterDBFileName); + finishWarnExit(); Config::deinit(); QTextCodec::deleteAllCodecs(); delete Doxygen::clangUsrMap; diff --git a/src/message.cpp b/src/message.cpp index e107139..95a7553 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -34,6 +34,14 @@ static const char *error_str = "error: "; static FILE *warnFile = stderr; +enum warn_as_error +{ + WARN_NO, + WARN_YES, + FAIL_ON_WARNINGS, +}; +static warn_as_error warnBehavior = WARN_NO; +static bool warnStat = false; static std::mutex g_mutex; @@ -99,7 +107,11 @@ void initWarningFormat() warnFile = stderr; } - if (Config_getBool(WARN_AS_ERROR)) + QCString warnStr = Config_getEnum(WARN_AS_ERROR).upper(); + if (warnStr =="NO") warnBehavior=WARN_NO; + else if (warnStr =="YES") warnBehavior=WARN_YES; + else if (warnStr =="FAIL_ON_WARNINGS") warnBehavior=FAIL_ON_WARNINGS; + if (warnBehavior == WARN_YES) { warning_str = error_str; } @@ -129,7 +141,6 @@ static void format_warn(const char *file,int line,const char *text) QCString textSubst = text; QCString versionSubst; // substitute markers by actual values - bool warnAsError = Config_getBool(WARN_AS_ERROR); QCString msgText = substitute( substitute( @@ -144,7 +155,7 @@ static void format_warn(const char *file,int line,const char *text) ), "$text",textSubst ); - if (warnAsError) + if (warnBehavior == WARN_YES) { msgText += " (warning treated as error, aborting now)"; } @@ -155,22 +166,23 @@ static void format_warn(const char *file,int line,const char *text) // print resulting message fwrite(msgText.data(),1,msgText.length(),warnFile); } - if (warnAsError) + if (warnBehavior == WARN_YES) { exit(1); } + warnStat = true; } static void handle_warn_as_error() { - static bool warnAsError = Config_getBool(WARN_AS_ERROR); - if (warnAsError) + if (warnBehavior == WARN_YES) { std::unique_lock<std::mutex> lock(g_mutex); QCString msgText = " (warning treated as error, aborting now)\n"; fwrite(msgText.data(),1,msgText.length(),warnFile); exit(1); } + warnStat = true; } static void do_warn(bool enabled, const char *file, int line, const char *prefix, const char *fmt, va_list args) @@ -312,3 +324,11 @@ void printlex(int dbg, bool enter, const char *lexName, const char *fileName) Debug::print(Debug::Lex,0,"%s lexical analyzer: %s\n",enter_txt_uc, qPrint(lexName)); } } + +extern void finishWarnExit() +{ + if (warnStat && warnBehavior == FAIL_ON_WARNINGS) + { + exit(1); + } +} diff --git a/src/message.h b/src/message.h index dd9eeeb..af49632 100644 --- a/src/message.h +++ b/src/message.h @@ -36,6 +36,7 @@ extern void err_full(const char *file,int line,const char *fmt, ...) PRINTFLIKE( extern void term(const char *fmt, ...) PRINTFLIKE(1, 2); void initWarningFormat(); void warn_flush(); +extern void finishWarnExit(); extern void printlex(int dbg, bool enter, const char *lexName, const char *fileName); |