21 : mColorTolerance( 0 )
27 mControlName = theName;
32 mControlPathPrefix = prefix;
37 mMapSettings = mapSettings;
42 bool successful =
false;
48 if ( subDirs.
count() == 0 )
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;
const QString controlImagePath() const
controlImagePath
void setControlPathSuffix(const QString &theName)
void setColorTolerance(unsigned int theColorTolerance)
Set tolerance for color components used by runTest() and compareImages().
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.
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...
int count(const T &value) const
void setRenderedImage(const QString &theImageFileName)
bool compareImages(const QString &theTestName, unsigned int theMismatchCount=0, QString theRenderedImageFile="")
Test using two arbitary images (map renderer will not be used)
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.
const QString & renderedImage()
The path of the rendered image can be retrieved through that method.
void setControlPathPrefix(const QString &theName)
Prefix where the control images are kept.
QStringList entryList(QFlags< QDir::Filter > filters, QFlags< QDir::SortFlag > sort) const
const QVector< QgsDartMeasurement > & dartMeasurements() const
Get access to buffered dash messages.