Skip to content
Permalink
Browse files

Add test for coverage of SIP bindings

Not perfect, but good for a quick warning if a new class or member
has been added to the public API without Python bindings. The test
only considers the name of members, since it seems to be impossible
to test for the signature of a Python member. (So adding a new
overloaded method without bindings will still unfortunately pass).

You can avoid the test where bindings are not applicable:
- for a whole class by placing "@note not available in Python bindings"
in the class' Doxygen comments
- or by placing the @note inside a member's Doxygen comments for a
specific member

Additionally, classes which aren't included in the API docs
will not be tested.
  • Loading branch information
nyalldawson committed Oct 27, 2015
1 parent 7842391 commit fc49f8dfa9b1076b8834a4c8f615e265153b088f
@@ -69,6 +69,10 @@ class QgsPaintEffectRegistry

public:

/** Returns a reference to the singleton instance of the paint effect registry.
*/
static QgsPaintEffectRegistry* instance();

/** Returns the metadata for a specific effect.
* @param name unique string name for paint effect class
* @returns paint effect metadata if found, otherwise NULL
@@ -44,4 +44,7 @@ class QgsFieldComboBox : QComboBox

//! setField sets the currently selected field
void setField( const QString& fieldName );

protected slots:
void indexChanged( int i );
};
@@ -154,6 +154,9 @@ class CORE_EXPORT QgsPaintEffectMetadata : public QgsPaintEffectAbstractMetadata
class CORE_EXPORT QgsPaintEffectRegistry
{
public:

/** Returns a reference to the singleton instance of the paint effect registry.
*/
static QgsPaintEffectRegistry* instance();

/** Returns the metadata for a specific effect.
@@ -98,6 +98,10 @@ class GEOSInit

static GEOSInit geosinit;

/**
* @brief Scoped GEOS pointer
* @note not available in Python bindings
*/
class GEOSGeomScopedPtr
{
public:
@@ -18,6 +18,11 @@
#include <QList>
#include "rtree.hpp"

/**
* \class pal::CostCalculator
* \note not available in Python bindings
*/

namespace pal
{
class Feats;
@@ -48,9 +53,11 @@ namespace pal
/**
* \brief Data structure to compute polygon's candidates costs
*
* eight segment from center of candidat to (rpx,rpy) points (0°, 45°, 90°, ..., 315°)
* Eight segments from center of candidate to (rpx,rpy) points (0°, 45°, 90°, ..., 315°)
* dist store the shortest square distance from the center to an object
* ok[i] is the to true whether the corresponding dist[i] is set
*
* \note not available in Python bindings
*/
class PolygonCostCalculator
{
@@ -41,6 +41,11 @@

#include "qgslabelingenginev2.h"

/**
* \class pal::LabelInfo
* \note not available in Python bindings
*/

namespace pal
{
/** Optional additional info about label (for curved labels) */
@@ -75,6 +80,8 @@ namespace pal

/**
* \brief Main class to handle feature
* \class pal::FeaturePart
* \note not available in Python bindings
*/
class CORE_EXPORT FeaturePart : public PointSet
{
@@ -44,6 +44,8 @@ namespace pal

/**
* \brief LabelPosition is a candidate feature label position
* \class pal::LabelPosition
* \note not available in Python bindings
*/
class CORE_EXPORT LabelPosition : public PointSet
{
@@ -48,11 +48,9 @@ namespace pal
class LabelInfo;

/**
* \brief A layer of spacial entites
*
* a layer is a bog of feature with some data which influence the labelling process
*
* \author Maxence Laurent (maxence _dot_ laurent _at_ heig-vd _dot_ ch)
* \brief A set of features which influence the labelling process
* \class pal::Layer
* \note not available in Python bindings
*/
class CORE_EXPORT Layer
{
@@ -41,14 +41,6 @@

class QgsAbstractLabelProvider;

/**
*
* \section intro_sec Introduction
*
* Pal is a labelling library released under the GPLv3 license
*
*/

namespace pal
{
/** Get GEOS context handle to be used in all GEOS library calls with reentrant API */
@@ -101,12 +93,12 @@ namespace pal
};

/**
* \brief Pal main class.
* \brief Main Pal labelling class
*
* A pal object will contains layers and global information such as which search method
* will be used.
*
* \author Maxence Laurent (maxence _dot_ laurent _at_ heig-vd _dot_ ch)
* \class pal::Pal
* \note not available in Python bindings
*/
class CORE_EXPORT Pal
{
@@ -36,8 +36,11 @@ namespace pal
{

/**
* Summury of problem
* \brief Summary statistics of labelling problem.
* \class pal::PalStat
* \note not available in Python bindings
*/

class PalStat
{

@@ -56,7 +56,10 @@ namespace pal
double length;
} CHullBox;


/**
* \class pal::PointSet
* \note not available in Python bindings
*/
class CORE_EXPORT PointSet
{
friend class FeaturePart;
@@ -39,7 +39,10 @@

namespace pal
{

/**
* \class pal::PriorityQueue
* \note not available in Python bindings
*/
class PriorityQueue
{

@@ -41,6 +41,10 @@ namespace pal
class LabelPosition;
class Label;

/**
* \class pal::Sol
* \note not available in Python bindings
*/
class Sol
{
public:
@@ -88,7 +92,9 @@ namespace pal
} Chain;

/**
* \brief Represent a problem
* \brief Representation of a labeling problem
* \class pal::Problem
* \note not available in Python bindings
*/
class CORE_EXPORT Problem
{
@@ -46,6 +46,7 @@ namespace pal

/**
* \brief For usage in problem solving algorithm
* \note not available in Python bindings
*/
class Feats
{
@@ -79,6 +79,8 @@ ENDIF (ENABLE_PGTEST)

IF (WITH_APIDOC)
ADD_PYTHON_TEST(PyQgsDocCoverage test_qgsdoccoverage.py)
#SIP coverage test relies on API doc parsing to identify members which should be in bindings
ADD_PYTHON_TEST(PyQgsSipCoverage test_qgssipcoverage.py)
ENDIF (WITH_APIDOC)

IF (WITH_SERVER)

1 comment on commit fc49f8d

@jef-n

This comment has been minimized.

Copy link
Member

@jef-n jef-n commented on fc49f8d Nov 1, 2015

fails on platforms that have don't have the QSci sip files installed and therefore have no bindings for (no HAVE_QSCI_SIP):

  • QgsCodeEditor
  • QgsCodeEditorPython

(Allegedly?) Missing methods

  • QgsIFeatureSelectionManager.selectionChanged
  • QgsVectorLayer.committedFeaturesRemoved
  • QgsVectorLayer.featuresDeleted
  • QgsVectorLayerEditBuffer.committedFeaturesRemoved
Please sign in to comment.
You can’t perform that action at this time.