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
|
|
@ -1,39 +1,47 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import doxygen_parsing
|
||||
import string
|
||||
import sys
|
||||
import re
|
||||
|
||||
def check(got, expected):
|
||||
if not re.match(str(expected), str(got)):
|
||||
raise RuntimeError("\n" + "Expected: [" + str(expected) + "]\n" + "Got : [" + str(got) + "]")
|
||||
#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_parsing.someFunction.__doc__, '\s+The function comment\s+')
|
||||
check(doxygen_parsing.SomeClass.__doc__, '\s+The class comment\s+')
|
||||
check(doxygen_parsing.SomeStruct.__doc__, '\s+The struct comment\s+')
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__, '\s+The class method comment\s+')
|
||||
check(doxygen_parsing.someFunction.__doc__, 'The function comment')
|
||||
check(doxygen_parsing.SomeClass.__doc__, 'The class comment')
|
||||
check(doxygen_parsing.SomeStruct.__doc__, 'The struct comment')
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__, 'The class method comment')
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethodExtended.__doc__, ''
|
||||
'\s+The class method with parameter'
|
||||
'\s+Arguments:\s+'
|
||||
'a \(int\)\s+-- Parameter a\s+'
|
||||
'b \(int\)\s+-- Parameter b\s+'
|
||||
'The class method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int) -- Parameter a\n'
|
||||
'b (int) -- Parameter b\n'
|
||||
)
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethodExtended2.__doc__, ''
|
||||
'\s+The class method with parameter'
|
||||
'\s+Arguments:\s+'
|
||||
'a \(int\)\s+-- Parameter a\s+'
|
||||
'b \(int\)\s+-- Parameter b\s+'
|
||||
'The class method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int)-- Parameter a\n'
|
||||
'b (int)-- Parameter b\n'
|
||||
)
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethod.__doc__, '\s+The struct method comment\s+')
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethod.__doc__, 'The struct method comment')
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethodExtended.__doc__, ''
|
||||
'\s+The struct method with parameter'
|
||||
'\s+Arguments:\s+'
|
||||
'a \(int\)\s+-- Parameter a\s+'
|
||||
'b \(int\)\s+-- Parameter b\s+'
|
||||
'The struct method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int)-- Parameter a\n'
|
||||
'b (int)-- Parameter b\n'
|
||||
)
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethodExtended2.__doc__, ''
|
||||
'\s+The struct method with parameter'
|
||||
'\s+Arguments:\s+'
|
||||
'a \(int\)\s+-- Parameter a\s+'
|
||||
'b \(int\)\s+-- Parameter b\s+'
|
||||
'The struct method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int)-- Parameter a\n'
|
||||
'b (int)-- Parameter b\n'
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue