Skip to content
Permalink
Browse files

Add a doxygen test to ensure all classes have a brief description

  • Loading branch information
nyalldawson committed Jul 10, 2016
1 parent 4145e33 commit b08dd47091c9a600896f5961e5336b1e9e533431
Showing with 300 additions and 5 deletions.
  1. +281 −0 tests/src/python/acceptable_missing_doc.py
  2. +4 −2 tests/src/python/test_qgsdoccoverage.py
  3. +15 −3 tests/src/python/utilities.py
@@ -1578,3 +1578,284 @@
"QgsActionMenu",
"QgsAuthMethod",
"QgsDartMeasurement"]

ACCEPTABLE_MISSING_BRIEF = ['QgsBrushStyleComboBox',
'QgsHiddenWidgetFactory',
'QgsLabelCandidate',
'QgsIDWInterpolator',
'QgsFeatureSelectionModel',
'QgsColorWidgetFactory',
'QgsFieldValidator',
'QgsPointCompare',
'QgsSvgSelectorWidget',
'QgsGeometryGeneratorSymbolLayerV2',
'QgsSurfaceV2',
'QgsSvgAnnotationItem',
'QgsCptCityColorRampV2Dialog',
'QgsRangeConfigDlg',
'QgsAttributeFormInterface',
'QgsExpression::NodeUnaryOperator',
'QgsSymbolLayerV2Widget',
'pal::PriorityQueue',
'QgsVectorLayerEditUtils',
'QgsArcProperter',
'QgsSimpleMarkerSymbolLayerV2Widget',
'QgsBrowserWatcher',
'QgsRandomColorsV2',
'QgsVectorLayerEditPassthrough',
'QgsDial',
'QgsVectorColorBrewerColorRampV2Dialog',
'QgsFontMarkerSymbolLayerV2Widget',
'QgsSymbolV2LevelItem',
'QgsGroupBoxCollapseButton',
'QgsVectorFieldSymbolLayerWidget',
'QgsCentroidFillSymbolLayerV2Widget',
'QgsEnumerationWidgetWrapper',
'QgsError',
'QgsRendererRangeV2LabelFormat',
'QgsMimeDataUtils',
'QgsRangeWidgetFactory',
'QgsCptCityArchive',
'QgsRasterRendererWidget',
'QgsGmlSchema',
'HalfEdge',
'QgsDateTimeEditFactory',
'QgsVectorFileWriter::BoolOption',
'QgsRasterFillSymbolLayerWidget',
'QgsVectorRandomColorRampV2Dialog',
'QgsSymbolV2RenderContext',
'QgsErrorDialog',
'QgsExpressionHighlighter',
'QgsFileNameWidgetFactory',
'QgsExpression::NodeLiteral',
'pal::CostCalculator',
'QgsFillSymbolLayerV2',
'QgsMultiBandColorRendererWidget',
'QgsRuleBasedLabeling::Rule',
'QgsSpatialIndexCopyVisitor',
'QgsSVGFillSymbolLayerWidget',
'QgsDataDefinedWidthDialog',
'QgsShapeburstFillSymbolLayerV2',
'QgsLegacyHelpers',
'QgsLineSymbolLayerV2',
'QgsWkbPtr',
'QgsSymbolLayerV2',
'QgsVectorFileWriter::StringOption',
'QgsSymbolLevelsV2Dialog',
'QgsPenJoinStyleComboBox',
'QgsValueRelationWidgetFactory',
'QgsGlowWidget',
'QgsDummyConfigDlg',
'QgsExpression::NodeFunction',
'QgsSvgSelectorGroupsModel',
'QgsAttributeTypeLoadDialog',
'QgsDirectoryParamWidget',
'QgsCategorizedSymbolRendererV2',
'QgsQtLocationConnection',
'QgsPropertyKey',
'QgsRuntimeProfiler',
'QgsVectorFileWriter::Option',
'QgsSymbolV2',
'QgsRendererRangeV2',
'QgsRasterCalcNode',
'QgsMessageBarItem',
'QgsVectorFileWriter::SetOption',
'QgsCacheIndexFeatureId',
'QgsRasterProjector',
'QgsPropertyValue',
'QgsAttributeTableFilterModel',
'QgsSingleSymbolRendererV2Widget',
'QgsValueMapConfigDlg',
'QgsSmartGroupCondition',
'QgsMarkerLineSymbolLayerV2Widget',
'QgsExpression::NodeList',
'QgsSymbolV2SelectorDialog',
'QgsPalLayerSettings',
'QgsTextEditConfigDlg',
'QgsWkbException',
'QgsSingleBandPseudoColorRendererWidget',
'QgsRuleBasedLabeling',
'QgsDxfExport',
'pal::GeomFunction',
'QgsRasterLayerSaveAsDialog',
'QgsStyleV2',
'QgsSizeScaleWidget',
'QgsSymbolsListWidget',
'QgsFontMarkerSymbolLayerV2',
'QgsLUDialog',
'QgsLegendInterface',
'QgsSublayersDialog',
'QgsDrawSourceWidget',
'QgsSingleBandGrayRendererWidget',
'QgsRelationEditorWidget',
'QgsFeatureSelectionDlg',
'QgsDataDefinedRotationDialog',
'QgsRendererV2PropertiesDialog',
'QgsDistanceArcProperter',
'QgsComposerLayerItem',
'QgsRelationReferenceFactory',
'QgsLongLongValidator',
'QgsExpression::WhenThen',
'QgsVectorFileWriter::IntOption',
'QgsUniqueValueWidgetFactory',
'QgsRelationReferenceWidget',
'QgsSLConnect',
'pal::LabelPosition',
'Node',
'QgsRendererRulePropsDialog',
'Qgs25DRendererWidget',
'QgsPalLabeling',
'QgsTextDiagram',
'QgsMapToolCapture',
'QgsConstWkbSimplifierPtr',
'QgsTextEditWidgetFactory',
'QgsNewVectorLayerDialog',
'QgsLogger',
'CharacterWidget',
'QgsPointDisplacementRendererWidget',
'QgsProjectFileTransform',
'QgsExpression::NodeInOperator',
'QgsLocaleNumC',
'QgsDatumTransformDialog',
'QgsColorRampComboBox',
'QgsGeometryValidator',
'QgsValueRelationConfigDlg',
'QgsComposerSymbolV2Item',
'QgsScaleRangeWidget',
'QgsPieDiagram',
'QgsVectorGradientColorRampV2Dialog',
'QgsPluginManagerInterface',
'QgsAttributeTableMapLayerAction',
'QgsConstWkbPtr',
'QgsStyleV2ExportImportDialog',
'QgsBrowserModel',
'QgsUniqueValuesConfigDlg',
'QgsStyleV2GroupSelectionDialog',
'QgsScaleVisibilityDialog',
'QgsSpatialIndex',
'QgsFeatureModel',
'QgsSvgMarkerSymbolLayerV2Widget',
'QgsFeatureListModel',
'QgsDataDefinedSizeDialog',
'QgsColorEffectWidget',
'QgsComposerStyleItem',
'QgsWebPage',
'QgsRelationReferenceConfigDlg',
'QgsVectorLayerEditBuffer',
'QgsGraduatedSymbolRendererV2Widget',
'QgsSimpleLineSymbolLayerV2',
'QgsSingleSymbolRendererV2',
'QgsComposerHtml',
'QgisInterface',
'QgsRuleBasedLabelProvider',
'QgsPointPatternFillSymbolLayer',
'QgsGradientFillSymbolLayerV2',
'QgsLinearlyInterpolatedDiagramRenderer',
'QgsWebViewWidgetConfigDlg',
'QgsGradientFillSymbolLayerV2Widget',
'QgsSlider',
'QgsPointPatternFillSymbolLayerWidget',
'QgsAttributeForm',
'pal::Sol',
'QgsCptCityColorRampV2',
'QgsComposerMultiFrameCommand',
'QgsSimpleLineSymbolLayerV2Widget',
'QgsValueMapWidgetFactory',
'QgsRelation',
'QgsInvertedPolygonRenderer',
'QgsExpression::Node',
'QgsTransformWidget',
'QgsGroupWMSDataDialog',
'QgsDataDefinedSymbolDialog',
'QgsColorBrewerPalette',
'LinTriangleInterpolator',
'QgsFontUtils',
'QgsDxfPaintEngine',
'QgsPenStyleComboBox',
'QgsRendererRulePropsWidget',
'QgsSimpleFillSymbolLayerV2',
'QgsExpression::NodeCondition',
'QgsClassificationWidgetWrapperFactory',
'QgsClassificationWidgetWrapper',
'QgsPhotoConfigDlg',
'QgsErrorMessage',
'QgsRelationWidgetWrapper',
'Qgs25DRenderer',
'QgsTrackedVectorLayerTools',
'QgsSymbolLayerV2Utils',
'QgsComposerRasterSymbolItem',
'Point3D',
'QgsGeometryGeneratorSymbolLayerWidget',
'QgsVectorLayerFeatureIterator',
'QgsFeatureRendererV2',
'QgsRasterMinMaxWidget',
'QgsDateTimeEditConfig',
'QgsSvgCacheEntry',
'QgsShapeburstFillSymbolLayerV2Widget',
'QgsMapLayerConfigWidgetFactory',
'QgsManageConnectionsDialog',
'QgsSvgSelectorListModel',
'QgsMarkerLineSymbolLayerV2',
'QgsScopeLogger',
'QgsExpression::NodeColumnRef',
'QgsCheckBoxConfigDlg',
'QgsDockWidget',
'QgsUuidWidgetFactory',
'QgsFeatureListViewDelegate',
'QgsOfflineEditing',
'QgsLabelPosition',
'QgsEnumerationWidgetFactory',
'QgsLinePatternFillSymbolLayerWidget',
'QgsSvgSelectorDialog',
'QgsGeometryCache',
'QgsRuleBasedRendererV2Widget',
'QgsScaleUtils',
'QgsMarkerSymbolV2',
'QgsPalettedRendererWidget',
'QgsPenCapStyleComboBox',
'QgsVectorFileWriter::HiddenOption',
'QgsExternalResourceWidgetFactory',
'QgsComposerGroupItem',
'QgsAttributeTableAction',
'QgsEditFormConfig',
'QgsCategorizedSymbolRendererV2Widget',
'QgsNewMemoryLayerDialog',
'QgsEllipseSymbolLayerV2Widget',
'QgsExpression::NodeBinaryOperator',
'QgsCentroidFillSymbolLayerV2',
'DualEdgeTriangulation',
'QgsLineSymbolV2',
'QgsHillshadeFilter',
'QgsServerInterface',
'QgsLayerPropertiesWidget',
'QgsLinePatternFillSymbolLayer',
'QgsWebViewWidgetFactory',
'QgsAttributeDialog',
'QgsGeometry::Error',
'QgsRasterMatrix',
'QgsPhotoWidgetFactory',
'QgsComposerEffect',
'QgsArrowSymbolLayerWidget',
'QgsFillSymbolV2',
'QgsVectorLayerSelectionManager',
'pal::PointSet',
'QgsSimpleFillSymbolLayerV2Widget',
'ParametricLine',
'QgsGraduatedSymbolRendererV2',
'QgsExternalResourceConfigDlg',
'QgsHistogramDiagram',
'QgsBlurWidget',
'QgsShadowEffectWidget',
'QgsRendererRasterPropertiesWidget',
'QgsVectorColorBrewerColorRampV2',
'QgsTransactionGroup',
'pal::Util',
'QgsDartMeasurement',
'QgsSvgMarkerSymbolLayerV2',
'QgsAlignRaster',
'QgsCheckboxWidgetFactory',
'QgsAddRemoveMultiFrameCommand',
'QgsCptCityBrowserModel',
'QgsSmartGroupEditorDialog',
'QgsHeatmapRendererWidget',
'QgsStyleV2ManagerDialog']
@@ -16,7 +16,7 @@
from qgis.testing import unittest

from utilities import printImportant, DoxygenParser
from acceptable_missing_doc import ACCEPTABLE_MISSING_DOCS, ACCEPTABLE_MISSING_ADDED_NOTE
from acceptable_missing_doc import ACCEPTABLE_MISSING_DOCS, ACCEPTABLE_MISSING_ADDED_NOTE, ACCEPTABLE_MISSING_BRIEF

# TO regenerate the list:
# uncomment the lines under the `# GEN LIST`
@@ -34,7 +34,7 @@ def testCoverage(self):
print('CTEST_FULL_OUTPUT')
prefixPath = os.environ['QGIS_PREFIX_PATH']
docPath = os.path.join(prefixPath, '..', 'doc', 'api', 'xml')
parser = DoxygenParser(docPath, ACCEPTABLE_MISSING_DOCS, ACCEPTABLE_MISSING_ADDED_NOTE)
parser = DoxygenParser(docPath, ACCEPTABLE_MISSING_DOCS, ACCEPTABLE_MISSING_ADDED_NOTE, ACCEPTABLE_MISSING_BRIEF)

coverage = 100.0 * parser.documented_members / parser.documentable_members
missing = parser.documentable_members - parser.documented_members
@@ -55,6 +55,8 @@ def testCoverage(self):

self.assertTrue(len(parser.classes_missing_version_added) == 0, 'FAIL: {} classes have been added without a version added doxygen note ("@note added in QGIS x.xx"):\n{}'.format(len(parser.classes_missing_version_added), '\n'.join(parser.classes_missing_version_added)))

self.assertTrue(len(parser.classes_missing_brief) == 0, 'FAIL: {} classes have been added without a brief description:\n{}'.format(len(parser.classes_missing_brief), '\n'.join(parser.classes_missing_brief)))


if __name__ == '__main__':
unittest.main()

0 comments on commit b08dd47

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