Skip to content
Permalink
Browse files
Update doc test for \since
  • Loading branch information
m-kuhn committed Apr 2, 2017
1 parent b55e4b9 commit 59e288c38e80f6f4659b8b027294184f13bc5cab
Showing with 8 additions and 6 deletions.
  1. +4 −4 tests/src/python/test_qgsdoccoverage.py
  2. +4 −2 tests/src/python/utilities.py
@@ -68,7 +68,7 @@ def testCoverage(self):
if parser.classes_missing_version_added:
print("---------------------------------")
print('\n')
print((colored('{} classes have been added without a version added doxygen note ("@note added in QGIS x.xx"):'.format(len(parser.classes_missing_version_added)), 'yellow')))
print((colored('{} classes have been added without a version added doxygen note ("\since QGIS x.xx"):'.format(len(parser.classes_missing_version_added)), 'yellow')))
print('')
print((' ' + '\n '.join([colored(cls, 'yellow', attrs=['bold']) for cls in parser.classes_missing_version_added])))

@@ -81,9 +81,9 @@ def testCoverage(self):

sys.stdout.flush()
self.assertTrue(not parser.undocumented_members, 'Undocumented members found')
self.assertTrue(not parser.classes_missing_group, 'Classes without \group tag found')
self.assertTrue(not parser.classes_missing_version_added, 'Classes without version added note found')
self.assertTrue(not parser.classes_missing_brief, 'Classes without brief description found')
self.assertTrue(not parser.classes_missing_group, 'Classes without \\group tag found')
self.assertTrue(not parser.classes_missing_version_added, 'Classes without \\since version tag found')
self.assertTrue(not parser.classes_missing_brief, 'Classes without \\brief description found')


if __name__ == '__main__':
@@ -18,6 +18,7 @@
import glob
import platform
import tempfile
import re

try:
from urllib2 import urlopen, HTTPError, URLError
@@ -358,6 +359,7 @@ def __init__(self, path, acceptable_missing={}, acceptable_missing_added_note=[]
'QgsSQLStatement::NodeUnaryOperator',
'QgsRuleBasedLabeling::Rule',
'QgsSQLStatement::Visitor']
self.version_regex = re.compile(r'QGIS [\d\.]+.*')
self.parseFiles(path)

def parseFiles(self, path):
@@ -526,9 +528,9 @@ def parseClassElem(self, e):
found_version_added = False
for para in d.getiterator('para'):
for s in para.getiterator('simplesect'):
if s.get('kind') == 'note':
if s.get('kind') == 'since':
for p in s.getiterator('para'):
if p.text and p.text.lower().startswith('added in'):
if self.version_regex.match(p.text):
found_version_added = True
break
if found_version_added:

0 comments on commit 59e288c

Please sign in to comment.