tests with escapes added, tests refactored - broken to smaller chunks
This commit is contained in:
parent
a9ef35bc66
commit
20cc685e8a
6 changed files with 220 additions and 138 deletions
|
|
@ -469,6 +469,10 @@ Here is the list of all Doxygen tags and the description of how they are transla
|
||||||
<td>translated to @exception</td>
|
<td>translated to @exception</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>\f$, \f[, \f], \f{, \f}</td>
|
||||||
|
<td>LateX formulas are left unchanged</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td>\if</td>
|
<td>\if</td>
|
||||||
<td>replaced with 'If: <condition> {'</td>
|
<td>replaced with 'If: <condition> {'</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -686,13 +690,6 @@ Here is the list of these tags:
|
||||||
<td>\enum</td>
|
<td>\enum</td>
|
||||||
<td>\example</td>
|
<td>\example</td>
|
||||||
<td>\extends</td>
|
<td>\extends</td>
|
||||||
<td>\f$</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>\f[</td>
|
|
||||||
<td>\f]</td>
|
|
||||||
<td>\f{</td>
|
|
||||||
<td>\f}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\file</td>
|
<td>\file</td>
|
||||||
|
|
|
||||||
|
|
@ -26,24 +26,39 @@ void isNoSpaceValidC()
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backslash following\c word is valid doxygen command. Output contains
|
* Backslash following\c word is a valid doxygen command. Output contains
|
||||||
* 'followingword' with word in 'code' font.
|
* 'followingword' with 'word' in 'code' font.
|
||||||
*/
|
*/
|
||||||
void backslashA()
|
void backslashA()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
// Output of escaped symbols below in doxygen generated HTML:
|
||||||
|
// Rendered: Escaped symbols: $ @ \ & < > # % " \. ::
|
||||||
|
// HTML source: Escaped symbols: $ @ \ & < > # % " \. ::
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doxy command without trailing \cspace space is ignored. Standalone
|
* Doxy command without trailing \cspace space is ignored - nothing appears
|
||||||
* \ and '\' get to output. Commands not recognized by Doxygen \blah
|
* on output. Standalone \ and '\' get to output.
|
||||||
* are ignored. Backslashes in DOS paths d:\xyz\c\myfile and words
|
* Standalone @ and '@' get to output.
|
||||||
* following them do not appear on output, we must quote them with
|
* Commands not recognized by Doxygen \blah @blah are ignored.
|
||||||
* double quotes: "d:\xyz\c\myfile", single quotes do not help:
|
* Backslashes in DOS paths d:\xyz\c\myfile and
|
||||||
|
* words following them do not appear on output, we must quote them with
|
||||||
|
* double quotes: "d:\xyz\c\myfile", "@something". single quotes do not help:
|
||||||
* 'd:\xyz\c\myfile'. Escaping works: d:\\xyz\\c\\myfile. Unix
|
* 'd:\xyz\c\myfile'. Escaping works: d:\\xyz\\c\\myfile. Unix
|
||||||
* paths of course have no such problems: /xyz/c/myfile
|
* paths of course have no such problems: /xyz/c/myfile
|
||||||
|
* Escaped symbols:
|
||||||
|
* \$ \@ \\ \& \~ \< \> \# \% \" \. \::
|
||||||
*/
|
*/
|
||||||
void backslashB()
|
void backslashB()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backslash e at end of \e line froze SWIG \e
|
||||||
|
* with old comment parser.
|
||||||
|
*/
|
||||||
|
void backslashC()
|
||||||
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
* You were warned!
|
* You were warned!
|
||||||
*
|
*
|
||||||
* \authors lots of them
|
* \authors lots of them
|
||||||
*
|
|
||||||
* \author Zubr
|
* \author Zubr
|
||||||
*
|
*
|
||||||
* \b boldword
|
* \b boldword
|
||||||
|
|
@ -26,21 +25,22 @@
|
||||||
* extended to many lines.
|
* extended to many lines.
|
||||||
*
|
*
|
||||||
* \bug Not everything works right now...
|
* \bug Not everything works right now...
|
||||||
*
|
|
||||||
* \c codeword
|
* \c codeword
|
||||||
*
|
*
|
||||||
* \callgraph
|
* \callgraph
|
||||||
*
|
|
||||||
* \callergraph
|
* \callergraph
|
||||||
*
|
|
||||||
* \category someCategory headerFile.h headerName
|
* \category someCategory headerFile.h headerName
|
||||||
*
|
*
|
||||||
* \cite citationword
|
* \cite citationword
|
||||||
*
|
|
||||||
* \class someClass headerFile.h headerName
|
* \class someClass headerFile.h headerName
|
||||||
*
|
|
||||||
* \code some test code \endcode
|
* \code some test code \endcode
|
||||||
*
|
*/
|
||||||
|
int func01(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \cond SOMECONDITION
|
* \cond SOMECONDITION
|
||||||
* Some conditional comment
|
* Some conditional comment
|
||||||
* \endcond
|
* \endcond
|
||||||
|
|
@ -63,7 +63,13 @@
|
||||||
*
|
*
|
||||||
* \details This is very large
|
* \details This is very large
|
||||||
* and detailed description of some thing
|
* and detailed description of some thing
|
||||||
*
|
*/
|
||||||
|
int func02(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \dir /somePath/someFolder
|
* \dir /somePath/someFolder
|
||||||
*
|
*
|
||||||
* \dontinclude someFile.h
|
* \dontinclude someFile.h
|
||||||
|
|
@ -87,6 +93,13 @@
|
||||||
*
|
*
|
||||||
* \example someFile.txt
|
* \example someFile.txt
|
||||||
* Some details on using the example
|
* Some details on using the example
|
||||||
|
*/
|
||||||
|
int func03(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
*
|
*
|
||||||
* \exception SuperError
|
* \exception SuperError
|
||||||
*
|
*
|
||||||
|
|
@ -115,7 +128,13 @@
|
||||||
* \htmlonly
|
* \htmlonly
|
||||||
* This will only appear in hmtl
|
* This will only appear in hmtl
|
||||||
* \endhtmlonly
|
* \endhtmlonly
|
||||||
*
|
*/
|
||||||
|
int func04(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \if ANOTHERCONDITION
|
* \if ANOTHERCONDITION
|
||||||
* First part of comment
|
* First part of comment
|
||||||
* \if SECONDCONDITION
|
* \if SECONDCONDITION
|
||||||
|
|
@ -150,7 +169,13 @@
|
||||||
*
|
*
|
||||||
* \invariant Some text
|
* \invariant Some text
|
||||||
* describing invariant.
|
* describing invariant.
|
||||||
*
|
*/
|
||||||
|
int func05(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \interface someInterface someHeader.h "Header name"
|
* \interface someInterface someHeader.h "Header name"
|
||||||
*
|
*
|
||||||
* \latexonly
|
* \latexonly
|
||||||
|
|
@ -186,7 +211,13 @@
|
||||||
* \mscfile mscFile.msc "The caption"
|
* \mscfile mscFile.msc "The caption"
|
||||||
*
|
*
|
||||||
* \n \n \n
|
* \n \n \n
|
||||||
*
|
*/
|
||||||
|
int func06(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \name someHeader.h
|
* \name someHeader.h
|
||||||
*
|
*
|
||||||
* \namespace someNamespace
|
* \namespace someNamespace
|
||||||
|
|
@ -221,7 +252,13 @@
|
||||||
* \privatesection
|
* \privatesection
|
||||||
*
|
*
|
||||||
* \property someVar
|
* \property someVar
|
||||||
*
|
*/
|
||||||
|
int func07(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \protected
|
* \protected
|
||||||
*
|
*
|
||||||
* \protectedsection
|
* \protectedsection
|
||||||
|
|
@ -253,7 +290,13 @@
|
||||||
* \returns may return
|
* \returns may return
|
||||||
*
|
*
|
||||||
* \retval someValue Some description
|
* \retval someValue Some description
|
||||||
*
|
*/
|
||||||
|
int func08(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \rtfonly
|
* \rtfonly
|
||||||
* This will only appear in RTF
|
* This will only appear in RTF
|
||||||
* \endrtfonly
|
* \endrtfonly
|
||||||
|
|
@ -294,7 +337,13 @@
|
||||||
* \throw superException
|
* \throw superException
|
||||||
*
|
*
|
||||||
* \throws RuntimeError
|
* \throws RuntimeError
|
||||||
*
|
*/
|
||||||
|
int func09(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \todo Some very important task
|
* \todo Some very important task
|
||||||
*
|
*
|
||||||
* \tparam b B is mentioned again...
|
* \tparam b B is mentioned again...
|
||||||
|
|
@ -331,7 +380,7 @@
|
||||||
*
|
*
|
||||||
* And here goes simple text
|
* And here goes simple text
|
||||||
*/
|
*/
|
||||||
int function(int a, float b)
|
int func10(int a, float b)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ public class commentParser {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int check(HashMap<String, String> wantedComments) {
|
public static int check(HashMap<String, String> wantedComments) {
|
||||||
int errorCount=0;
|
int errorCount=0;
|
||||||
Iterator< Entry<String, String> > it = parsedComments.entrySet().iterator();
|
Iterator< Entry<String, String> > it = parsedComments.entrySet().iterator();
|
||||||
|
|
@ -55,10 +56,10 @@ public class commentParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!actualStr.equals(wantedStr)) {
|
if (!actualStr.equals(wantedStr)) {
|
||||||
System.out.println("Documentation comments for " + e.getKey() + " does not match: ");
|
System.out.println("Documentation comments for " + e.getKey() + " do not match: ");
|
||||||
// here we print original strings, for nicer output
|
// here we print original strings, for nicer output
|
||||||
System.out.println("\texpected:"+wantedComments.get(e.getKey()));
|
System.out.println("\n\n---\nexpected:\n" + wantedComments.get(e.getKey()));
|
||||||
System.out.println("\tgot:\t"+e.getValue());
|
System.out.println("\n\n---\ngot:\n" + e.getValue());
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -68,9 +69,10 @@ public class commentParser {
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return errorCount;
|
return errorCount > 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void printCommentListForJavaSource() {
|
public static void printCommentListForJavaSource() {
|
||||||
Iterator< Entry<String, String> > it = parsedComments.entrySet().iterator();
|
Iterator< Entry<String, String> > it = parsedComments.entrySet().iterator();
|
||||||
while (it.hasNext())
|
while (it.hasNext())
|
||||||
|
|
@ -84,6 +86,7 @@ public class commentParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String argv[]) {
|
public static void main(String argv[]) {
|
||||||
|
|
||||||
if (argv.length<1) {
|
if (argv.length<1) {
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,22 @@ public class doxygen_translate_all_tags_runme {
|
||||||
|
|
||||||
HashMap<String, String> wantedComments = new HashMap<String, String>();
|
HashMap<String, String> wantedComments = new HashMap<String, String>();
|
||||||
|
|
||||||
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.function(int, float)",
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func01(int)",
|
||||||
" <i>Hello </i>\n" +
|
" <i>Hello </i>\n\n\n\n\n\n" +
|
||||||
" <li>some list item \n" +
|
" <li>some list item</li>\n\n" +
|
||||||
" </li>This is attention! \n" +
|
" This is attention!\n" +
|
||||||
" You were warned!\n" +
|
" You were warned!\n" +
|
||||||
" @author lots of them\n" +
|
" @author lots of them\n" +
|
||||||
" @author Zubr \n" +
|
" @author Zubr\n\n" +
|
||||||
" <b>boldword </b>\n" +
|
" <b>boldword</b>\n\n" +
|
||||||
" Some brief description,\n" +
|
" Some brief description,\n" +
|
||||||
" extended to many lines. \n" +
|
" extended to many lines.\n\n" +
|
||||||
" Not everything works right now...\n" +
|
" Not everything works right now...\n" +
|
||||||
" <code>codeword </code>\n" +
|
" <code>codeword</code>\n\n\n\n\n\n" +
|
||||||
" <i>citationword</i>\n" +
|
" <i>citationword</i>\n" +
|
||||||
" {@code some test code }\n" +
|
" {@code some test code }\n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func02(int)",
|
||||||
" Conditional comment: SOMECONDITION \n" +
|
" Conditional comment: SOMECONDITION \n" +
|
||||||
" Some conditional comment \n" +
|
" Some conditional comment \n" +
|
||||||
" End of conditional comment.\n" +
|
" End of conditional comment.\n" +
|
||||||
|
|
@ -46,11 +48,17 @@ public class doxygen_translate_all_tags_runme {
|
||||||
" 1970 - 2012 \n" +
|
" 1970 - 2012 \n" +
|
||||||
" @deprecated Now use another function \n" +
|
" @deprecated Now use another function \n" +
|
||||||
" This is very large \n" +
|
" This is very large \n" +
|
||||||
" and detailed description of some thing \n" +
|
" and detailed description of some thing \n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func03(int)",
|
||||||
" <i>italicword </i>\n" +
|
" <i>italicword </i>\n" +
|
||||||
" <i>emphazedWord </i>\n" +
|
" <i>emphazedWord </i>\n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func04(int)",
|
||||||
" @exception SuperError \n" +
|
" @exception SuperError \n" +
|
||||||
" This will only appear in hmtl \n" +
|
" This will only appear in hmtl \n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func05(int)",
|
||||||
" If: ANOTHERCONDITION {\n" +
|
" If: ANOTHERCONDITION {\n" +
|
||||||
" First part of comment \n" +
|
" First part of comment \n" +
|
||||||
" If: SECONDCONDITION {\n" +
|
" If: SECONDCONDITION {\n" +
|
||||||
|
|
@ -69,7 +77,9 @@ public class doxygen_translate_all_tags_runme {
|
||||||
" }\n" +
|
" }\n" +
|
||||||
" <img src=testImage.bmp alt=\"Hello, world!\" />\n" +
|
" <img src=testImage.bmp alt=\"Hello, world!\" />\n" +
|
||||||
" Some text \n" +
|
" Some text \n" +
|
||||||
" describing invariant. \n" +
|
" describing invariant. \n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func06(int)",
|
||||||
" This will only appear in LATeX \n" +
|
" This will only appear in LATeX \n" +
|
||||||
" <ul> \n" +
|
" <ul> \n" +
|
||||||
" <li>Some unordered list \n" +
|
" <li>Some unordered list \n" +
|
||||||
|
|
@ -77,7 +87,9 @@ public class doxygen_translate_all_tags_runme {
|
||||||
" </li><li>lots of lots of items \n" +
|
" </li><li>lots of lots of items \n" +
|
||||||
" </li></ul> \n" +
|
" </li></ul> \n" +
|
||||||
" {@link someMember Some description follows }\n" +
|
" {@link someMember Some description follows }\n" +
|
||||||
" This will only appear in man \n" +
|
" This will only appear in man\n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func07(int)",
|
||||||
" Note: Here \n" +
|
" Note: Here \n" +
|
||||||
" is the note! \n" +
|
" is the note! \n" +
|
||||||
" This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.\n" +
|
" This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.\n" +
|
||||||
|
|
@ -87,12 +99,16 @@ public class doxygen_translate_all_tags_runme {
|
||||||
" The paragraph text. \n" +
|
" The paragraph text. \n" +
|
||||||
" Maybe even multiline \n" +
|
" Maybe even multiline \n" +
|
||||||
" </p>\n" +
|
" </p>\n" +
|
||||||
" @param a the first param \n" +
|
" @param a the first param\n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func08(int)",
|
||||||
" Remarks: Some remark text \n" +
|
" Remarks: Some remark text \n" +
|
||||||
" Remarks: Another remarks section \n" +
|
" Remarks: Another remarks section \n" +
|
||||||
" @return Whatever \n" +
|
" @return Whatever \n" +
|
||||||
" @return it \n" +
|
" @return it \n" +
|
||||||
" @return may return \n" +
|
" @return may return \n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func09(int)",
|
||||||
" This will only appear in RTF \n" +
|
" This will only appear in RTF \n" +
|
||||||
" @see someOtherMethod \n" +
|
" @see someOtherMethod \n" +
|
||||||
" @see function \n" +
|
" @see function \n" +
|
||||||
|
|
@ -100,7 +116,9 @@ public class doxygen_translate_all_tags_runme {
|
||||||
" brief description \n" +
|
" brief description \n" +
|
||||||
" @since version 0.0.0.1 \n" +
|
" @since version 0.0.0.1 \n" +
|
||||||
" @throws superException \n" +
|
" @throws superException \n" +
|
||||||
" @throws RuntimeError \n" +
|
" @throws RuntimeError \n");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func10(int, float)",
|
||||||
" TODO: Some very important task \n" +
|
" TODO: Some very important task \n" +
|
||||||
" @param b B is mentioned again... \n" +
|
" @param b B is mentioned again... \n" +
|
||||||
" {@literal \n" +
|
" {@literal \n" +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue