Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rearrange outputs in SIP test, so that missing list is always printed
  • Loading branch information
nyalldawson committed Nov 10, 2015
1 parent 7c149d7 commit bbf58fd
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions tests/src/python/test_qgssipcoverage.py
Expand Up @@ -61,22 +61,6 @@ def testCoverage(self):

missing_objects.sort()

missing_count = len(missing_objects)
present_count = len(objects) - missing_count
coverage = 100.0 * present_count / len(objects)

print "---------------------------------"
printImportant("{} total bindable classes".format(len(objects)))
printImportant("{} total have bindings".format(present_count))
printImportant("Binding coverage by classes {}%".format(coverage))
printImportant("---------------------------------")
printImportant("{} classes missing bindings, out of {} allowed".format(missing_count, ACCEPTABLE_MISSING_CLASSES))
print "---------------------------------"

assert missing_count <= ACCEPTABLE_MISSING_CLASSES, """\n\nFAIL: new unbound classes have been introduced, please add SIP bindings for these classes
If these classes are not suitable for the Python bindings, please add the Doxygen tag
"@note not available in Python bindings" to the CLASS Doxygen comments"""

#next check for individual members
parser.bindable_members.sort()
missing_members = []
Expand All @@ -87,22 +71,41 @@ def testCoverage(self):
missing_members.append('{}.{}'.format(m[0], m[1]))

missing_members.sort()
missing_count = len(missing_members)
present_count = len(parser.bindable_members) - missing_count

print "---------------------------------"
print 'Missing classes:\n {}'.format('\n '.join(missing_objects))
print "---------------------------------"
print 'Missing members:\n {}'.format('\n '.join(missing_members))

#print summaries
missing_class_count = len(missing_objects)
present_count = len(objects) - missing_class_count
coverage = 100.0 * present_count / len(objects)

print "---------------------------------"
printImportant("{} total bindable classes".format(len(objects)))
printImportant("{} total have bindings".format(present_count))
printImportant("Binding coverage by classes {}%".format(coverage))
printImportant("---------------------------------")
printImportant("{} classes missing bindings, out of {} allowed".format(missing_class_count, ACCEPTABLE_MISSING_CLASSES))
print "---------------------------------"

missing_member_count = len(missing_members)
present_count = len(parser.bindable_members) - missing_member_count
coverage = 100.0 * present_count / len(parser.bindable_members)

print "---------------------------------"
printImportant("{} total bindable members".format(len(parser.bindable_members)))
printImportant("{} total have bindings".format(present_count))
printImportant("Binding coverage by members {}%".format(coverage))
printImportant("---------------------------------")
printImportant("{} members missing bindings, out of {} allowed".format(missing_count, ACCEPTABLE_MISSING_MEMBERS))
print "---------------------------------"
print 'Missing classes:\n {}'.format('\n '.join(missing_objects))
print "---------------------------------"
print 'Missing members:\n {}'.format('\n '.join(missing_members))
printImportant("{} members missing bindings, out of {} allowed".format(missing_member_count, ACCEPTABLE_MISSING_MEMBERS))

assert missing_class_count <= ACCEPTABLE_MISSING_CLASSES, """\n\nFAIL: new unbound classes have been introduced, please add SIP bindings for these classes
If these classes are not suitable for the Python bindings, please add the Doxygen tag
"@note not available in Python bindings" to the CLASS Doxygen comments"""

assert missing_count <= ACCEPTABLE_MISSING_MEMBERS, """\n\nFAIL: new unbound members have been introduced, please add SIP bindings for these members
assert missing_member_count <= ACCEPTABLE_MISSING_MEMBERS, """\n\nFAIL: new unbound members have been introduced, please add SIP bindings for these members
If these members are not suitable for the Python bindings, please add the Doxygen tag
"@note not available in Python bindings" to the MEMBER Doxygen comments"""

Expand Down

0 comments on commit bbf58fd

Please sign in to comment.