swig/Examples/test-suite/python/doxygen_parsing_runme.py
Vadim Zeitlin 8b83976f4c Fix arguments of @param, @return etc translations to Python.
For the parameter documentation to be really taken as such, in its entirety,
by Sphinx, it must be indented relative to the :param: tag. Do this by
appending an extra indent after every line of the output and work around the
unnecessary indent of the last line by removing the trailing whitespace.

This required updating the existing tests and removing the expected but not
present any more whitespace from them, but as trailing whitespace in the
documentation is at best insignificant (and at worst harmful) anyhow, this is
not a big price to pay for simpler translator code.
2014-08-22 17:45:22 +02:00

68 lines
1.7 KiB
Python

#!/usr/bin/python
import doxygen_parsing
import string
import sys
import commentVerifier
commentVerifier.check(doxygen_parsing.someFunction.__doc__,
r"""
The function comment
""")
commentVerifier.check(doxygen_parsing.SomeClass.__doc__,
r"""
The class comment
""")
commentVerifier.check(doxygen_parsing.SomeStruct.__doc__,
r"""
The struct comment
""")
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__,
r"""
The class method comment.
SomeAnotherClass#classMethodExtended(int, int) a link text
""")
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethodExtended.__doc__,
r"""
The class method with parameter
:type a: int
:param a: Parameter a
:type b: int
:param b: Parameter b
"""
)
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethodExtended2.__doc__,
r"""
The class method with parameter
:type a: int
:param a: Parameter a
:type b: int
:param b: Parameter b
"""
)
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethod.__doc__,
r"""
The struct method comment
""")
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethodExtended.__doc__,
r"""
The struct method with parameter
:type a: int
:param a: Parameter a
:type b: int
:param b: Parameter b
"""
)
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethodExtended2.__doc__,
r"""
The struct method with parameter
:type a: int
:param a: Parameter a
:type b: int
:param b: Parameter b
""")