Skip to content

Building & Testing ​

The repository has a build script and a DUnitX test suite, used to check every change on the command line.

build.cmd ​

bash
build.cmd 13 all demos
ArgumentMeaning
versionDelphi version: 13 (default), 12
platformwin32 (default, dcc32), win64 (dcc64), all (both)
demosalso build every demo project

The arguments can be given in any order. For each platform the script compiles:

  1. every unit of source\ (a generated program that uses them all);
  2. the test suite tests\FMXERTests.dpr, then runs it;
  3. with demos, every .dpr under demos\.

Everything is written under build\<version>\<platform> (ignored by git): the projects and their .res files are not touched. At the end it prints a summary of every step of every platform (also in build\<version>\summary.txt); the exit code is 0 when every step succeeded. Each step has its log (*.compile.log, FMXERTests.log) next to its output.

Run build.cmd all demos before a release: Win64 catches what Win32 hides, such as Length and Count being NativeInt there (the tests compare them with Assert.AreEqual<NativeInt>).

Dependencies ​

By default the script uses the submodules in lib\. To use other folders — installed libraries, other clones — set these environment variables first:

VariableDefault
FMXER_TFRAMESTANDlib\TFrameStand\source
FMXER_IFILlib\IconFontsImageList\Source
FMXER_ZXINGQRlib\DelphiZXingQRCode\Source
FMXER_ZXINGlib\ZXing.Delphi\Lib\Classes (QRCode demo)
FMXER_MARSnone: the MARS-Curiosity Source folder (LibraryStore demo)

The test suite ​

tests\FMXERTests.dpr is a DUnitX console program. FMX runs headless enough on Windows for the tests: forms and frames are created and shown through their stands, but no window appears. Timers and delayed actions are pumped by a small loop (Tests.Common.Pump).

UnitCovers
Tests.Navigatorroutes, stack and breadcrumb, StackPop, transient routes, CloseAllRoutes/CloseAllRoutesExcept, events, delayed routing
Tests.Elementsscaffold action buttons and snackbar, pair stands, card glyph, icon font cache, list view refresh and item handlers, form helpers

Run it from the IDE or directly:

bash
build\13\Win32\tests\FMXERTests.exe --pause

A NUnit-style XML report (FMXERTests.xml) is written next to the executable.

To test a new defect, add a test that fails first, then fix the code: the tests of v.1.2 were written this way, and 11 of the 21 fail on v.1.1.

Packages ​

packages\12Athens and packages\13Florence hold the runtime packages (FMXERPackage, FMXERQRCodePackage, see Installation) and FMXER.groupproj. Build them from the IDE or with MSBuild; to keep the IDE's own Bpl and Dcp folders untouched (where the installed packages are), pass the output folders:

bash
msbuild packages\13Florence\FMXERPackage.dproj /p:Config=Release /p:Platform=Win64 /p:DCC_BplOutput=C:\Temp\fmxer\bpl /p:DCC_DcpOutput=C:\Temp\fmxer\dcp /p:DCC_DcuOutput=C:\Temp\fmxer\dcu

A new unit in source\ goes in both packages folders: FMXERPackage, or FMXERQRCodePackage when it uses DelphiZXingQRCode.

The setup ​

setup\build-setup.cmd builds build\setup\FMXER_<version>_Setup.exe with Inno Setup 6, from a clean export of HEAD (committed files only). The setup is based on the same Ethea InnoSetup library as the TFrameStand and MARS-Curiosity setups; the version is LibraryVersion in setup\Setup.iss (and version.txt for TMS Smart Setup, see tmsbuild.yaml).

Released under the Mozilla Public License 2.0.