Test Suite
From version 4.8.0 the library includes an automated Test Suite, written with DUnitX for Delphi 13, in the Test folder of the project.
What is tested
- The ISVG contract, against every engine. The same tests run on Image32, SVGMagic, Skia4Delphi and Direct2D: FixedColor (also on outline icons with
fill="none"and withApplyFixedColorToRootOnly), GrayScale on and off, Opacity,clNone, Width/Height, Source and SaveToStream, Clear and IsEmpty, errors on invalid SVG (ESVGException), reloading documents with nested ids used by<use>. - The VCL components: TSVGIconImageList, TSVGIconImageCollection, TSVGIconVirtualImageList (its own FixedColor also with AutoFill and on disabled icons), TSVGIconImage, TSVGGraphic, TSVGIconItem and the SVGIconUtils helpers.
- The FMX components: TSVGIconImageList (names, destinations, streaming of inherited attributes, Zoom, ApplyFixedColorToRootOnly, LoadFromFiles), TFmxImageSVG and TSVGIconImage.
- The
PreferNativeSvgSupportconfiguration: a small project builds the library with that define and checks that the global factory renders.
Rendering is checked with pixel probes: the icon is painted on a 32-bit bitmap with a known background and the color of some pixels is compared with the expected one. Every test of a fixed bug is written so that it fails on the code before the fix.
How to run it
Test\run_tests.cmd [Win32|Win64] [Debug|Release]The script finds the newest Delphi installed (or uses the BDS environment variable, or the path passed as third parameter), builds and runs the three projects of Test\Projects\D13 and returns 0 when every test passed. The default is Win64/Debug, with range and overflow checking on.
| Project | Content |
|---|---|
SVGIconImageListTests | Engines (ISVG contract) and VCL components |
SVGIconImageListFMXTests | FMX components |
EngineConfigCheck | Build of the library with PreferNativeSvgSupport |
The reports, in NUnit XML format, are written to Test\Bin\<platform>\<config> (dunitx-results.xml and dunitx-fmx-results.xml).
Known issues of the engines
The differences that come from the third-party libraries are kept as tests marked [Ignore], so that they are documented and can be enabled once the library is fixed: see Known issues.