Skip to content

Commit

Permalink
Update doc test for \since
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 2, 2017
1 parent b55e4b9 commit 59e288c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/src/python/test_qgsdoccoverage.py
Expand Up @@ -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])))

Expand All @@ -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__':
Expand Down
6 changes: 4 additions & 2 deletions tests/src/python/utilities.py
Expand Up @@ -18,6 +18,7 @@
import glob
import platform
import tempfile
import re

try:
from urllib2 import urlopen, HTTPError, URLError
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 59e288c

Please sign in to comment.