Fixed and updated all doxygen python tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13346 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4c293c8282
commit
8a683e42d0
4 changed files with 562 additions and 24 deletions
62
Examples/test-suite/python/doxygen_basic_translate_runme.py
Normal file
62
Examples/test-suite/python/doxygen_basic_translate_runme.py
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import doxygen_basic_translate
|
||||
import string
|
||||
import sys
|
||||
|
||||
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_basic_translate.function.__doc__, ''
|
||||
' Brief description.\n'
|
||||
' The comment text\n'
|
||||
' Authors:\n'
|
||||
' Some author\n'
|
||||
' Return:\n'
|
||||
' Some number\n'
|
||||
' See also:\n'
|
||||
' function2\n'
|
||||
)
|
||||
check(doxygen_basic_translate.function2.__doc__, ''
|
||||
' 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.'
|
||||
)
|
||||
check(doxygen_basic_translate.function3.__doc__, ''
|
||||
' ----------------------------------------------------------------\n'
|
||||
' Overload 1:\n'
|
||||
' ----------------------------------------------------------------\n'
|
||||
' A test for overloaded functions\n'
|
||||
' This is function __one__\n'
|
||||
' ----------------------------------------------------------------\n'
|
||||
' Overload 2:\n'
|
||||
' ----------------------------------------------------------------\n'
|
||||
' A test for overloaded functions\n'
|
||||
' This is function __two__\n'
|
||||
)
|
||||
check(doxygen_basic_translate.function4.__doc__, ''
|
||||
' A test of some mixed tag usage\n'
|
||||
' If: CONDITION {\n'
|
||||
' This _code_fragment shows us something .\n'
|
||||
' Title: Minuses:\n'
|
||||
' -it\'s senseless\n'
|
||||
' -it\'s stupid\n'
|
||||
' -it\'s null\n'
|
||||
' Warning:\n'
|
||||
' This may not work as expected\n'
|
||||
' int main() { while(true); }\n'
|
||||
' }'
|
||||
)
|
||||
check(doxygen_basic_translate.function5.__doc__, ''
|
||||
' Test for default args'
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue