diff options
author | John McFarland <mcfarljm@gmail.com> | 2019-05-25 11:34:15 -0500 |
---|---|---|
committer | John McFarland <mcfarljm@gmail.com> | 2019-05-25 16:25:54 -0500 |
commit | 91a90b8d27e759d5504bc3be72a300fe4c68b8ad (patch) | |
tree | 1fa25d9a04db7821e4a4d7aca76da6cf4cf88483 /Examples/test-suite/python/doxygen_basic_translate_style2_runme.py | |
parent | 98ae66b6fcaaee19f62141bb3c30de0ae6ff7cca (diff) | |
download | swig-91a90b8d27e759d5504bc3be72a300fe4c68b8ad.tar.gz |
Adding test for second doxygen comment style
This style looks like:
/** Line 1
* Line 2
*/
This is needed to verify fixes to some of the indentation in the
translated comments.
The test is copied from doxygen_basic_translate.i. One adjustment was
made to change the comment style on the last function that left out
the intermediate "*" characters. This does not produce correct output
when combined with this style of starting the text on the first
comment line.
Test results are copied directly from doxygen_basic_translate. A
minor difference in the Python results will be updated in a subsequent
commit.
Diffstat (limited to 'Examples/test-suite/python/doxygen_basic_translate_style2_runme.py')
-rw-r--r-- | Examples/test-suite/python/doxygen_basic_translate_style2_runme.py | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/Examples/test-suite/python/doxygen_basic_translate_style2_runme.py b/Examples/test-suite/python/doxygen_basic_translate_style2_runme.py new file mode 100644 index 000000000..c8d24ab72 --- /dev/null +++ b/Examples/test-suite/python/doxygen_basic_translate_style2_runme.py @@ -0,0 +1,82 @@ +import doxygen_basic_translate_spaced +import inspect +import string +import sys +import comment_verifier + +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function), + """\ +Brief description. + +The comment text. + +Author: Some author + +:rtype: int +:return: Some number + +See also: function2""" +) +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function2), + """\ +A test of a very very very very very very very very very very very very very very very very +very very very very very long comment string.""" +) +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function3), + """*Overload 1:* + +A test for overloaded functions +This is function **one** + +| + +*Overload 2:* + +A test for overloaded functions +This is function **two**""" +) +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function4), + """\ +A test of some mixed tag usage +If: CONDITION { +This *code* fragment shows us something . +Title: Minuses: +* it\'s senseless +* it\'s stupid +* it\'s null + +Warning: This may not work as expected + +.. code-block:: c++ + + int main() { while(true); } +}""" +) +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function5), + """This is a post comment.""" +) +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function6), + """\ +Test for default args +:type a: int +:param a: Some parameter, default is 42""" +) +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.function7), + """\ +Test for a parameter with difficult type +(mostly for python) +:type a: :py:class:`Shape` +:param a: Very strange param""" +) + +comment_verifier.check(inspect.getdoc(doxygen_basic_translate_spaced.Atan2), + """\ +Multiple parameters test. + +:type y: float +:param y: Vertical coordinate. +:type x: float +:param x: Horizontal coordinate. +:rtype: float +:return: Arc tangent of ``y/x``.""" +) |