21 : mColorTolerance( 0 )
27 mControlName = theName;
32 mControlPathPrefix = prefix;
37 mMapSettings = mapSettings;
42 bool successful =
false;
55 Q_FOREACH (
const QString& suffix, subDirs )
57 qDebug() <<
"Checking subdir " << suffix;
67 if ( !mRenderedImage.
isNull() )
70 result = checker.
compareImages( theTestName, theMismatchCount, mRenderedImage );
74 result = checker.
runTest( theTestName, theMismatchCount );
82 mReport += checker.
report();
91 "If this is a rendering inconsistency, please add another control image folder, add an anomaly image or increase the color tolerance." );
100 QString myDataDir( TEST_DATA_DIR );
103 return myControlImageDir;
void setControlPathSuffix(const QString &theName)
void setColorTolerance(unsigned int theColorTolerance)
Set tolerance for color components used by runTest() and compareImages().
QVector< QgsDartMeasurement > dartMeasurements() const
Get access to buffered dash messages.
void enableDashBuffering(bool enable)
Call this to enable internal buffering of dash messages.
void setControlName(const QString &theName)
Base directory name for the control image (with control image path suffixed) the path to the image wi...
bool runTest(const QString &theTestName, unsigned int theMismatchCount=0)
Test using renderer to generate the image to be compared.
QString renderedImage()
The path of the rendered image can be retrieved through that method.
This is a helper class for unit tests that need to write an image and compare it to an expected resul...
void setMapSettings(const QgsMapSettings &mapSettings)
The QgsMapSettings class contains configuration for rendering of the map.
void setControlName(const QString &theName)
Base directory name for the control image (with control image path suffixed) the path to the image wi...
bool compareImages(const QString &theTestName, unsigned int theMismatchCount=0, const QString &theRenderedImageFile="")
Test using two arbitary images (map renderer will not be used)
void setRenderedImage(const QString &theImageFileName)
void setMapSettings(const QgsMapSettings &mapSettings)
Set the map settings to use to render the image.
void setControlPathPrefix(const QString &prefix)
bool runTest(const QString &theTestName, unsigned int theMismatchCount=0)
Test using renderer to generate the image to be compared.
void setControlPathPrefix(const QString &theName)
Prefix where the control images are kept.
QStringList entryList(QFlags< QDir::Filter > filters, QFlags< QDir::SortFlag > sort) const
QString controlImagePath() const
controlImagePath