A Google Test fixture for tests that compare rendered SVG output against golden images.
More...
#include "donner/svg/renderer/tests/ImageComparisonTestFixture.h"
|
| SVGDocument | loadSVG (const char *filename, const std::optional< std::filesystem::path > &resourceDir=std::nullopt) |
| | Loads an SVG document from the given filename.
|
| void | renderAndCompare (SVGDocument &document, const std::filesystem::path &svgFilename, const char *goldenImageFilename) |
| | Renders the given SVG document and compares it against a golden image.
|
| void | renderAndCompare (SVGDocument &document, const std::filesystem::path &svgFilename, const char *goldenImageFilename, const ImageComparisonParams ¶ms) |
| | Renders the given SVG document and compares it against a golden image using specified parameters.
|
A Google Test fixture for tests that compare rendered SVG output against golden images.
This fixture is parameterized with ImageComparisonTestcase, allowing multiple SVG files to be tested with different comparison parameters. It provides helper methods for loading SVG documents and performing the rendering and comparison.
◆ loadSVG()
| SVGDocument donner::svg::ImageComparisonTestFixture::loadSVG |
( |
const char * | filename, |
|
|
const std::optional< std::filesystem::path > & | resourceDir = std::nullopt ) |
|
protected |
Loads an SVG document from the given filename.
- Parameters
-
| filename | The path to the SVG file. |
| resourceDir | Optional path to a directory containing resources (e.g., external images) referenced by the SVG. |
- Returns
- The loaded SVGDocument.
◆ renderAndCompare() [1/2]
| void donner::svg::ImageComparisonTestFixture::renderAndCompare |
( |
SVGDocument & | document, |
|
|
const std::filesystem::path & | svgFilename, |
|
|
const char * | goldenImageFilename ) |
|
protected |
Renders the given SVG document and compares it against a golden image.
Uses default comparison parameters.
- Parameters
-
| document | The SVGDocument to render. |
| svgFilename | The original path of the SVG file (used for naming output files). |
| goldenImageFilename | The path to the golden image file. |
◆ renderAndCompare() [2/2]
| void donner::svg::ImageComparisonTestFixture::renderAndCompare |
( |
SVGDocument & | document, |
|
|
const std::filesystem::path & | svgFilename, |
|
|
const char * | goldenImageFilename, |
|
|
const ImageComparisonParams & | params ) |
|
protected |
Renders the given SVG document and compares it against a golden image using specified parameters.
- Parameters
-
| document | The SVGDocument to render. |
| svgFilename | The original path of the SVG file (used for naming output files). |
| goldenImageFilename | The path to the golden image file. |
| params | The ImageComparisonParams to use for the comparison. |
The documentation for this class was generated from the following files: