16#ifndef QGSMULTIRENDERCHECKER_H
17#define QGSMULTIRENDERCHECKER_H
71 void setControlName(
const QString &name );
78 void setFileFunctionLine(
const QString &file,
const QString &function,
int line );
83 void setControlPathPrefix(
const QString &prefix );
91 void setRenderedImage(
const QString &renderedImagePath ) { mRenderedImage = renderedImagePath; }
121 void setSizeTolerance(
int xTolerance,
int yTolerance ) { mMaxSizeDifferenceX = xTolerance; mMaxSizeDifferenceY = yTolerance; }
136 bool runTest(
const QString &testName,
unsigned int mismatchCount = 0 );
145 QString report()
const;
155 QString markdownReport()
const;
160 QString controlImagePath()
const;
170 QString mSourceFunction;
171 int mSourceLine = -1;
173 bool mResult =
false;
175 QString mReportHeader;
178 QString mMarkdownReportHeader;
179 QString mMarkdownReport;
181 QString mRenderedImage;
182 QString mControlName;
183 QString mControlPathPrefix;
184 unsigned int mColorTolerance = 0;
185 int mMaxSizeDifferenceX = 0;
186 int mMaxSizeDifferenceY = 0;
188 bool mExpectFail =
false;
190 bool mIsCiRun =
false;
207 QgsLayoutChecker(
const QString &testName,
QgsLayout *layout );
212 void setSize( QSize size ) { mSize = size; }
233 bool testLayout( QString &report
SIP_OUT,
int page = 0,
int pixelDiff = 0,
bool createReferenceImage =
false );
236 QgsLayoutChecker() =
delete;
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
The QgsMapSettings class contains configuration for rendering of the map.
This class allows checking rendered images against comparison images.
void setRenderedImage(const QString &renderedImagePath)
Set the path to the rendered image.
static void drawBackground(QImage *image)
Draws a checkboard pattern for image backgrounds, so that opacity is visible without requiring a tran...
virtual ~QgsMultiRenderChecker()=default
void setColorTolerance(unsigned int colorTolerance)
Set tolerance for color components used by runTest() Default value is 0.
void setExpectFail(bool expectFail)
Sets whether the comparison is expected to fail.
void setSizeTolerance(int xTolerance, int yTolerance)
Sets the largest allowable difference in size between the rendered and the expected image.
static void drawBackground(QImage *image)
Draws a checkboard pattern for image backgrounds, so that opacity is visible without requiring a tran...