updated two additional python doxygen tests

This commit is contained in:
Marko Klopcic 2013-02-07 08:46:38 +01:00
commit 77b6099c05
2 changed files with 336 additions and 311 deletions

View file

@ -3,176 +3,216 @@
import doxygen_translate_all_tags
import string
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__, ''
' _Hello_'
''
' -some list item '
''
' This is attention! '
' You were warned! '
''
' Authors:'
' lots of them '
''
' Zubr '
''
' __boldword__'
''
' Some brief description, '
' extended to many lines. '
''
' Not everything works right now... '
''
' codeword'
''
' \'citationword\''
''
' some test code '
''
' Conditional comment: SOMECONDITION'
' Some conditional comment '
' End of conditional comment.'
''
' Copyright:'
' some copyright '
''
' 1970 - 2012 '
''
' Deprecated:'
' Now use another function '
''
' This is very large '
' and detailed description of some thing '
''
' _italicword_'
''
' emphazedWord'
''
' Example:'
' someFile.txt'
' Some details on using the example '
''
' Throws:'
' SuperError'
''
' This will only appear in hmtl '
''
' If: ANOTHERCONDITION {'
' First part of comment '
' If: SECONDCONDITION {'
' Nested condition text '
' }Else if: THIRDCONDITION {'
' The third condition text '
' }Else: {The last text block '
' }'
' }Else: {Second part of comment '
' If: CONDITION {'
' Second part extended '
' }'
' }'
''
' If not: SOMECONDITION {'
' This is printed if not '
' }'
''
' Image: testImage.bmp(Hello, world!)'
''
' Some text '
' describing invariant. '
''
' This will only appear in LATeX '
''
' <ul> '
''
' -Some unordered list '
' -With lots of items '
' -lots of lots of items '
''
' </ul> '
''
' someMember Some description follows '
''
' This will only appear in man '
''
' Notes:'
' Here '
' is the note! '
''
' This is an overloaded member function, provided for convenience.'
' It differs from the above function only in what argument(s) it accepts.'
''
' someword'
''
' Title: The paragraph title '
' The paragraph text. '
' Maybe even multiline '
''
' Arguments:'
' a (int) -- the first param '
''
' Remarks:'
' Some remark text '
''
' Another remarks section '
''
' Return:'
' Whatever '
''
' it '
''
' may return '
''
' This will only appear in RTF '
''
''
' See also:'
' someOtherMethod '
''
' function '
''
' Same as '
' brief description '
''
' Since:'
' version 0.0.0.1 '
''
' Throws:'
' superException'
''
' RuntimeError'
''
' 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 '
)
commentVerifier.check(doxygen_translate_all_tags.func01.__doc__,
r"""
_Hello_
-some list item
This is attention!
You were warned!
Authors: lots of them
Author: Zubr
__boldword__
Some brief description,
extended to many lines.
Not everything works right now...
'codeword'
'citationword'
some test code
""")
commentVerifier.check(doxygen_translate_all_tags.func02.__doc__,
r"""
Conditional comment: SOMECONDITION
Some conditional comment
End of conditional comment.
Copyright: some copyright
1970 - 2012
Deprecated: Now use another function
This is very large
and detailed description of some thing
""")
commentVerifier.check(doxygen_translate_all_tags.func03.__doc__,
r"""
Comment for __func03().__
_italicword_
emphazedWord
Example: someFile.txt
Some details on using the example
""")
commentVerifier.check(doxygen_translate_all_tags.func04.__doc__,
r"""
Throws: SuperError
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
This will only appear in hmtl
""")
commentVerifier.check(doxygen_translate_all_tags.func05.__doc__,
r"""
If: ANOTHERCONDITION {
First part of comment
If: SECONDCONDITION {
Nested condition text
}Else if: THIRDCONDITION {
The third condition text
}Else: {The last text block
}
}Else: {Second part of comment
If: CONDITION {
Second part extended
}
}
If not: SOMECONDITION {
This is printed if not
}
Image: testImage.bmp("Hello, world!")
Some text
describing invariant.
""")
commentVerifier.check(doxygen_translate_all_tags.func06.__doc__,
r"""
This will only appear in LATeX
-Some unordered list
-With lots of items
-lots of lots of items
someMember Some description follows
This will only appear in man
""")
commentVerifier.check(doxygen_translate_all_tags.func07.__doc__,
r"""
Notes: Here
is the note!
This is an overloaded member function, provided for convenience.
It differs from the above function only in what argument(s) it accepts.
someword
Title: The paragraph title
The paragraph text.
Maybe even multiline
Arguments:
a (int) -- the first param
""")
commentVerifier.check(doxygen_translate_all_tags.func08.__doc__,
r"""
Remarks:
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
""")

View file

@ -3,146 +3,131 @@
import doxygen_translate
import string
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__, ''
' _Hello_'
''
' -some list item '
''
' Authors:'
' lots of them '
''
' Zubr '
''
' __boldword__'
''
' codeword'
''
' \'citationword\''
''
' some test code '
''
' Conditional comment: SOMECONDITION'
' Some conditional comment '
' End of conditional comment.'
''
' Copyright:'
' some copyright '
''
' Deprecated:'
' Now use another function '
''
' _italicword_'
''
' Example:'
' someFile.txt'
' Some details on using the example '
''
' Throws:'
' SuperError'
''
' If: ANOTHERCONDITION {'
' First part of comment '
' If: SECONDCONDITION {'
' Nested condition text '
' }Else if: THIRDCONDITION {'
' The third condition text '
' }Else: {The last text block '
' }'
' }Else: {Second part of comment '
' If: CONDITION {'
' Second part extended '
' }'
' }'
''
' If not: SOMECONDITION {'
' This is printed if not '
' }'
''
' Image: testImage.bmp(Hello, world!)'
''
' <ul> '
''
' -Some unordered list '
' -With lots of items '
' -lots of lots of items '
''
' </ul> '
''
' someMember Some description follows '
''
' Notes:'
' Here '
' is the note! '
''
' This is an overloaded member function, provided for convenience.'
' It differs from the above function only in what argument(s) it accepts.'
''
' someword'
''
''
''
' Title: The paragraph title '
' The paragraph text. '
' Maybe even multiline '
''
' Arguments:'
' a (int) -- the first param '
''
' Remarks:'
' Some remark text '
''
' Another remarks section '
''
' Return:'
' Whatever '
''
' it '
''
' may return '
''
' See also:'
' someOtherMethod '
''
' function '
''
' Since:'
' version 0.0.0.1 '
''
' Throws:'
' superException'
''
' RuntimeError'
''
' 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! '
''
' Here goes test of symbols: '
' $@\&~<>#%".::'
''
' And here goes simple text '
commentVerifier.check(doxygen_translate.function.__doc__,
r"""
_Hello_
-some list item
Authors: lots of them
Author: Zubr
__boldword__
'codeword'
'citationword'
some test code
Conditional comment: SOMECONDITION
Some conditional comment
End of conditional comment.
Copyright: some copyright
Deprecated: Now use another function
_italicword_
Example: someFile.txt
Some details on using the example
Throws: SuperError
If: ANOTHERCONDITION {
First part of comment
If: SECONDCONDITION {
Nested condition text
}Else if: THIRDCONDITION {
The third condition text
}Else: {The last text block
}
}Else: {Second part of comment
If: CONDITION {
Second part extended
}
}
If not: SOMECONDITION {
This is printed if not
}
Image: testImage.bmp("Hello, world!")
-Some unordered list
-With lots of items
-lots of lots of items
someMember Some description follows
Notes: Here
is the note!
This is an overloaded member function, provided for convenience.
It differs from the above function only in what argument(s) it accepts.
someword
Title: The paragraph title
The paragraph text.
Maybe even multiline
Arguments:
a (int) -- the first param
Remarks: Some remark text
Another remarks section
Return: Whatever
it
Returns: may return
See also: someOtherMethod
function
Since: version 0.0.0.1
Throw: superException
Throws: RuntimeError
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!
Here goes test of symbols:
$ @ \ & ~ < > # % " . ::
And here goes simple text
"""
)