Skip to content
Permalink
Browse files

Ignore typedefs and deprecated members in sip coverage test

  • Loading branch information
nyalldawson committed Nov 9, 2015
1 parent 1b28984 commit b1b20af8fbebba504de61ee4086e87ea781fa517
Showing with 36 additions and 8 deletions.
  1. +36 −8 tests/src/python/utilities.py
@@ -555,6 +555,10 @@ def elemIsBindableMember(self, elem):
if self.isFriendClass(elem):
return False

# ignore typedefs (can't test for them)
if self.isTypeDef(elem):
return False

if self.isVariable(elem) and self.visibility(elem) == 'protected':
#protected variables can't be bound in SIP
return False
@@ -579,6 +583,10 @@ def elemIsBindableMember(self, elem):
if self.isOperator(elem):
return False

# ignore deprecated members
if self.isDeprecated(elem):
return False

return True

def elemIsDocumentableMember(self, elem):
@@ -631,12 +639,8 @@ def elemIsDocumentableMember(self, elem):
pass

# ignore deprecated members
typeelem = elem.find('type')
try:
if typeelem.text and 'Q_DECL_DEPRECATED' in typeelem.text:
return False
except:
pass
if self.isDeprecated(elem):
return False

return True

@@ -718,8 +722,18 @@ def isFriendClass(self, member_elem):
:param member_elem: XML element for a class member
"""
try:
definition = member_elem.find('definition').text
if definition.startswith('friend class'):
if member_elem.get('kind') == 'friend':
return True
except:
pass
return False

def isTypeDef(self, member_elem):
""" Tests whether an member is a type def
:param member_elem: XML element for a class member
"""
try:
if member_elem.get('kind') == 'typedef':
return True
except:
pass
@@ -741,6 +755,20 @@ def isReimplementation(self, member_elem):

return False

def isDeprecated(self, member_elem):
""" Tests whether an member is deprecated
:param member_elem: XML element for a class member
"""

type_elem = member_elem.find('type')
try:
if 'Q_DECL_DEPRECATED' in type_elem.text:
return True
except:
pass

return False

def memberIsDocumented(self, member_elem):
""" Tests whether an member has documentation
:param member_elem: XML element for a class member

0 comments on commit b1b20af

Please sign in to comment.
You can’t perform that action at this time.