updated two additional python doxygen tests
This commit is contained in:
parent
08093ec17e
commit
77b6099c05
2 changed files with 336 additions and 311 deletions
|
|
@ -3,176 +3,216 @@
|
||||||
import doxygen_translate_all_tags
|
import doxygen_translate_all_tags
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
|
import commentVerifier
|
||||||
|
|
||||||
def check(got, expected):
|
|
||||||
#if got is Null
|
|
||||||
# raise RuntimeError('Expected comment string\n')
|
|
||||||
gotStr = string.replace(got, ' ', '')
|
|
||||||
gotStr = string.replace(gotStr, '\n', '')
|
|
||||||
gotStr = string.replace(gotStr, '\t', '')
|
|
||||||
expectedStr = string.replace(expected, ' ', '')
|
|
||||||
expectedStr = string.replace(expectedStr, '\n', '')
|
|
||||||
expectedStr = string.replace(expectedStr, '\t', '')
|
|
||||||
if not gotStr == expectedStr:
|
|
||||||
raise RuntimeError("Expected: [" + str(expected) + "]\n" + "Got : [" + str(got) + "]\n")
|
|
||||||
|
|
||||||
check(doxygen_translate_all_tags.function.__doc__, ''
|
commentVerifier.check(doxygen_translate_all_tags.func01.__doc__,
|
||||||
' _Hello_'
|
r"""
|
||||||
''
|
_Hello_
|
||||||
' -some list item '
|
|
||||||
''
|
|
||||||
' This is attention! '
|
|
||||||
' You were warned! '
|
|
||||||
''
|
|
||||||
' Authors:'
|
-some list item
|
||||||
' lots of them '
|
|
||||||
''
|
This is attention!
|
||||||
' Zubr '
|
You were warned!
|
||||||
''
|
|
||||||
' __boldword__'
|
Authors: lots of them
|
||||||
''
|
Author: Zubr
|
||||||
' Some brief description, '
|
|
||||||
' extended to many lines. '
|
__boldword__
|
||||||
''
|
|
||||||
' Not everything works right now... '
|
Some brief description,
|
||||||
''
|
extended to many lines.
|
||||||
' codeword'
|
|
||||||
''
|
Not everything works right now...
|
||||||
' \'citationword\''
|
'codeword'
|
||||||
''
|
|
||||||
' some test code '
|
|
||||||
''
|
|
||||||
' Conditional comment: SOMECONDITION'
|
|
||||||
' Some conditional comment '
|
|
||||||
' End of conditional comment.'
|
'citationword'
|
||||||
''
|
|
||||||
' Copyright:'
|
some test code
|
||||||
' some copyright '
|
""")
|
||||||
''
|
|
||||||
' 1970 - 2012 '
|
commentVerifier.check(doxygen_translate_all_tags.func02.__doc__,
|
||||||
''
|
r"""
|
||||||
' Deprecated:'
|
Conditional comment: SOMECONDITION
|
||||||
' Now use another function '
|
Some conditional comment
|
||||||
''
|
End of conditional comment.
|
||||||
' This is very large '
|
|
||||||
' and detailed description of some thing '
|
|
||||||
''
|
|
||||||
' _italicword_'
|
|
||||||
''
|
|
||||||
' emphazedWord'
|
|
||||||
''
|
|
||||||
' Example:'
|
Copyright: some copyright
|
||||||
' someFile.txt'
|
|
||||||
' Some details on using the example '
|
1970 - 2012
|
||||||
''
|
|
||||||
' Throws:'
|
|
||||||
' SuperError'
|
|
||||||
''
|
|
||||||
' This will only appear in hmtl '
|
|
||||||
''
|
Deprecated: Now use another function
|
||||||
' If: ANOTHERCONDITION {'
|
|
||||||
' First part of comment '
|
This is very large
|
||||||
' If: SECONDCONDITION {'
|
and detailed description of some thing
|
||||||
' Nested condition text '
|
""")
|
||||||
' }Else if: THIRDCONDITION {'
|
|
||||||
' The third condition text '
|
commentVerifier.check(doxygen_translate_all_tags.func03.__doc__,
|
||||||
' }Else: {The last text block '
|
r"""
|
||||||
' }'
|
Comment for __func03().__
|
||||||
' }Else: {Second part of comment '
|
|
||||||
' If: CONDITION {'
|
|
||||||
' Second part extended '
|
|
||||||
' }'
|
|
||||||
' }'
|
|
||||||
''
|
|
||||||
' If not: SOMECONDITION {'
|
|
||||||
' This is printed if not '
|
|
||||||
' }'
|
|
||||||
''
|
_italicword_
|
||||||
' Image: testImage.bmp(Hello, world!)'
|
|
||||||
''
|
emphazedWord
|
||||||
' Some text '
|
|
||||||
' describing invariant. '
|
|
||||||
''
|
|
||||||
' This will only appear in LATeX '
|
Example: someFile.txt
|
||||||
''
|
Some details on using the example
|
||||||
' <ul> '
|
""")
|
||||||
''
|
|
||||||
' -Some unordered list '
|
commentVerifier.check(doxygen_translate_all_tags.func04.__doc__,
|
||||||
' -With lots of items '
|
r"""
|
||||||
' -lots of lots of items '
|
Throws: SuperError
|
||||||
''
|
|
||||||
' </ul> '
|
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||||
''
|
|
||||||
' someMember Some description follows '
|
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||||
''
|
|
||||||
' This will only appear in man '
|
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||||
''
|
|
||||||
' Notes:'
|
This will only appear in hmtl
|
||||||
' Here '
|
""")
|
||||||
' is the note! '
|
|
||||||
''
|
commentVerifier.check(doxygen_translate_all_tags.func05.__doc__,
|
||||||
' This is an overloaded member function, provided for convenience.'
|
r"""
|
||||||
' It differs from the above function only in what argument(s) it accepts.'
|
If: ANOTHERCONDITION {
|
||||||
''
|
First part of comment
|
||||||
' someword'
|
If: SECONDCONDITION {
|
||||||
''
|
Nested condition text
|
||||||
' Title: The paragraph title '
|
}Else if: THIRDCONDITION {
|
||||||
' The paragraph text. '
|
The third condition text
|
||||||
' Maybe even multiline '
|
}Else: {The last text block
|
||||||
''
|
}
|
||||||
' Arguments:'
|
}Else: {Second part of comment
|
||||||
' a (int) -- the first param '
|
If: CONDITION {
|
||||||
''
|
Second part extended
|
||||||
' Remarks:'
|
}
|
||||||
' Some remark text '
|
}
|
||||||
''
|
|
||||||
' Another remarks section '
|
If not: SOMECONDITION {
|
||||||
''
|
This is printed if not
|
||||||
' Return:'
|
}
|
||||||
' Whatever '
|
|
||||||
''
|
Image: testImage.bmp("Hello, world!")
|
||||||
' it '
|
|
||||||
''
|
Some text
|
||||||
' may return '
|
describing invariant.
|
||||||
''
|
""")
|
||||||
' This will only appear in RTF '
|
|
||||||
''
|
commentVerifier.check(doxygen_translate_all_tags.func06.__doc__,
|
||||||
''
|
r"""
|
||||||
' See also:'
|
This will only appear in LATeX
|
||||||
' someOtherMethod '
|
|
||||||
''
|
|
||||||
' function '
|
|
||||||
''
|
-Some unordered list
|
||||||
' Same as '
|
-With lots of items
|
||||||
' brief description '
|
-lots of lots of items
|
||||||
''
|
|
||||||
' Since:'
|
|
||||||
' version 0.0.0.1 '
|
|
||||||
''
|
someMember Some description follows
|
||||||
' Throws:'
|
|
||||||
' superException'
|
This will only appear in man
|
||||||
''
|
""")
|
||||||
' RuntimeError'
|
|
||||||
''
|
commentVerifier.check(doxygen_translate_all_tags.func07.__doc__,
|
||||||
' TODO:'
|
r"""
|
||||||
' Some very important task '
|
Notes: Here
|
||||||
''
|
is the note!
|
||||||
' Arguments:'
|
|
||||||
' b (float) -- B is mentioned again... '
|
This is an overloaded member function, provided for convenience.
|
||||||
''
|
It differs from the above function only in what argument(s) it accepts.
|
||||||
' very long '
|
|
||||||
' text with tags <sometag> '
|
someword
|
||||||
''
|
|
||||||
' Version:'
|
Title: The paragraph title
|
||||||
' 0.0.0.2 '
|
The paragraph text.
|
||||||
''
|
Maybe even multiline
|
||||||
' Warning:'
|
|
||||||
' This is senseless! '
|
Arguments:
|
||||||
''
|
a (int) -- the first param
|
||||||
' This will only appear in XML '
|
""")
|
||||||
''
|
|
||||||
' Here goes test of symbols: '
|
commentVerifier.check(doxygen_translate_all_tags.func08.__doc__,
|
||||||
' $@\&~<>#%".::'
|
r"""
|
||||||
''
|
Remarks:
|
||||||
' And here goes simple text '
|
Some remark text
|
||||||
)
|
|
||||||
|
Another remarks section
|
||||||
|
|
||||||
|
Return: Whatever
|
||||||
|
|
||||||
|
it
|
||||||
|
|
||||||
|
may return
|
||||||
|
""")
|
||||||
|
|
||||||
|
commentVerifier.check(doxygen_translate_all_tags.func09.__doc__,
|
||||||
|
r"""
|
||||||
|
This will only appear in RTF
|
||||||
|
|
||||||
|
|
||||||
|
See also: someOtherMethod
|
||||||
|
|
||||||
|
function
|
||||||
|
|
||||||
|
Same as
|
||||||
|
brief description
|
||||||
|
|
||||||
|
Since: version 0.0.0.1
|
||||||
|
|
||||||
|
Throws: superException
|
||||||
|
|
||||||
|
RuntimeError
|
||||||
|
""")
|
||||||
|
|
||||||
|
commentVerifier.check(doxygen_translate_all_tags.func10.__doc__,
|
||||||
|
r"""
|
||||||
|
TODO:
|
||||||
|
Some very important task
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
b (float) -- B is mentioned again...
|
||||||
|
|
||||||
|
very long
|
||||||
|
text with tags <sometag>
|
||||||
|
|
||||||
|
Version: 0.0.0.2
|
||||||
|
|
||||||
|
Warning: This is senseless!
|
||||||
|
|
||||||
|
This will only appear in XML
|
||||||
|
|
||||||
|
Here goes test of symbols:
|
||||||
|
$ @ \ & ~ < > # % " . ::
|
||||||
|
|
||||||
|
And here goes simple text
|
||||||
|
""")
|
||||||
|
|
|
||||||
|
|
@ -3,146 +3,131 @@
|
||||||
import doxygen_translate
|
import doxygen_translate
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
|
import commentVerifier
|
||||||
|
|
||||||
def check(got, expected):
|
|
||||||
#if got is Null
|
|
||||||
# raise RuntimeError('Expected comment string\n')
|
|
||||||
gotStr = string.replace(got, ' ', '')
|
|
||||||
gotStr = string.replace(gotStr, '\n', '')
|
|
||||||
gotStr = string.replace(gotStr, '\t', '')
|
|
||||||
expectedStr = string.replace(expected, ' ', '')
|
|
||||||
expectedStr = string.replace(expectedStr, '\n', '')
|
|
||||||
expectedStr = string.replace(expectedStr, '\t', '')
|
|
||||||
if not gotStr == expectedStr:
|
|
||||||
raise RuntimeError("Expected: [" + str(expected) + "]\n" + "Got : [" + str(got) + "]\n")
|
|
||||||
|
|
||||||
check(doxygen_translate.function.__doc__, ''
|
commentVerifier.check(doxygen_translate.function.__doc__,
|
||||||
' _Hello_'
|
r"""
|
||||||
''
|
_Hello_
|
||||||
' -some list item '
|
|
||||||
''
|
-some list item
|
||||||
' Authors:'
|
|
||||||
' lots of them '
|
Authors: lots of them
|
||||||
''
|
|
||||||
' Zubr '
|
Author: Zubr
|
||||||
''
|
|
||||||
' __boldword__'
|
__boldword__
|
||||||
''
|
|
||||||
' codeword'
|
'codeword'
|
||||||
''
|
|
||||||
' \'citationword\''
|
'citationword'
|
||||||
''
|
|
||||||
' some test code '
|
some test code
|
||||||
''
|
|
||||||
' Conditional comment: SOMECONDITION'
|
Conditional comment: SOMECONDITION
|
||||||
' Some conditional comment '
|
Some conditional comment
|
||||||
' End of conditional comment.'
|
End of conditional comment.
|
||||||
''
|
|
||||||
' Copyright:'
|
Copyright: some copyright
|
||||||
' some copyright '
|
|
||||||
''
|
Deprecated: Now use another function
|
||||||
' Deprecated:'
|
|
||||||
' Now use another function '
|
_italicword_
|
||||||
''
|
|
||||||
' _italicword_'
|
Example: someFile.txt
|
||||||
''
|
Some details on using the example
|
||||||
' Example:'
|
|
||||||
' someFile.txt'
|
Throws: SuperError
|
||||||
' Some details on using the example '
|
|
||||||
''
|
If: ANOTHERCONDITION {
|
||||||
' Throws:'
|
First part of comment
|
||||||
' SuperError'
|
If: SECONDCONDITION {
|
||||||
''
|
Nested condition text
|
||||||
' If: ANOTHERCONDITION {'
|
}Else if: THIRDCONDITION {
|
||||||
' First part of comment '
|
The third condition text
|
||||||
' If: SECONDCONDITION {'
|
}Else: {The last text block
|
||||||
' Nested condition text '
|
}
|
||||||
' }Else if: THIRDCONDITION {'
|
}Else: {Second part of comment
|
||||||
' The third condition text '
|
If: CONDITION {
|
||||||
' }Else: {The last text block '
|
Second part extended
|
||||||
' }'
|
}
|
||||||
' }Else: {Second part of comment '
|
}
|
||||||
' If: CONDITION {'
|
|
||||||
' Second part extended '
|
If not: SOMECONDITION {
|
||||||
' }'
|
This is printed if not
|
||||||
' }'
|
}
|
||||||
''
|
|
||||||
' If not: SOMECONDITION {'
|
Image: testImage.bmp("Hello, world!")
|
||||||
' This is printed if not '
|
|
||||||
' }'
|
|
||||||
''
|
|
||||||
' Image: testImage.bmp(Hello, world!)'
|
-Some unordered list
|
||||||
''
|
-With lots of items
|
||||||
' <ul> '
|
-lots of lots of items
|
||||||
''
|
|
||||||
' -Some unordered list '
|
|
||||||
' -With lots of items '
|
|
||||||
' -lots of lots of items '
|
someMember Some description follows
|
||||||
''
|
|
||||||
' </ul> '
|
|
||||||
''
|
|
||||||
' someMember Some description follows '
|
|
||||||
''
|
|
||||||
' Notes:'
|
|
||||||
' Here '
|
Notes: Here
|
||||||
' is the note! '
|
is the note!
|
||||||
''
|
|
||||||
' This is an overloaded member function, provided for convenience.'
|
This is an overloaded member function, provided for convenience.
|
||||||
' It differs from the above function only in what argument(s) it accepts.'
|
It differs from the above function only in what argument(s) it accepts.
|
||||||
''
|
|
||||||
' someword'
|
someword
|
||||||
''
|
|
||||||
''
|
|
||||||
''
|
|
||||||
' Title: The paragraph title '
|
Title: The paragraph title
|
||||||
' The paragraph text. '
|
The paragraph text.
|
||||||
' Maybe even multiline '
|
Maybe even multiline
|
||||||
''
|
|
||||||
' Arguments:'
|
Arguments:
|
||||||
' a (int) -- the first param '
|
a (int) -- the first param
|
||||||
''
|
|
||||||
' Remarks:'
|
Remarks: Some remark text
|
||||||
' Some remark text '
|
|
||||||
''
|
Another remarks section
|
||||||
' Another remarks section '
|
|
||||||
''
|
Return: Whatever
|
||||||
' Return:'
|
|
||||||
' Whatever '
|
it
|
||||||
''
|
|
||||||
' it '
|
Returns: may return
|
||||||
''
|
|
||||||
' may return '
|
See also: someOtherMethod
|
||||||
''
|
|
||||||
' See also:'
|
function
|
||||||
' someOtherMethod '
|
|
||||||
''
|
Since: version 0.0.0.1
|
||||||
' function '
|
|
||||||
''
|
Throw: superException
|
||||||
' Since:'
|
|
||||||
' version 0.0.0.1 '
|
Throws: RuntimeError
|
||||||
''
|
|
||||||
' Throws:'
|
TODO: Some very important task
|
||||||
' superException'
|
|
||||||
''
|
Arguments:
|
||||||
' RuntimeError'
|
b (float) -- B is mentioned again...
|
||||||
''
|
|
||||||
' TODO:'
|
|
||||||
' Some very important task '
|
very long
|
||||||
''
|
text with tags <sometag>
|
||||||
' Arguments:'
|
|
||||||
' b (float) -- B is mentioned again... '
|
|
||||||
''
|
Version: 0.0.0.2
|
||||||
' very long '
|
|
||||||
' text with tags <sometag> '
|
Warning: This is senseless!
|
||||||
''
|
|
||||||
' Version:'
|
Here goes test of symbols:
|
||||||
' 0.0.0.2 '
|
$ @ \ & ~ < > # % " . ::
|
||||||
''
|
|
||||||
' Warning:'
|
And here goes simple text
|
||||||
' This is senseless! '
|
"""
|
||||||
''
|
|
||||||
' Here goes test of symbols: '
|
|
||||||
' $@\&~<>#%".::'
|
|
||||||
''
|
|
||||||
' And here goes simple text '
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue