Testing Options for Delphi
Depending on the version of Delphi in use, unit/integrate testing tools include:
DUnit
-the original framework with the latest version of 9.4. Embarcadero stills ships this with Delphi.
DUnitX
-released by VSoft Technologies (makers of FinalBuilder) and requires D2010 or higher
-uses attributes to mark test related methods
DUnit2
-a fork of DUnit started by Peter McNab
-introduces SetupOnce/TearDownOnce and other enhancements
-has been extended by tiOPF project
SmokeTest
-newer framework for Joylon Smith, recently released that uses Interfaces rather than abstract classes
DUnitLite
-an extension to DUnit offering more check methods with additional datatypes, and a fluid interface
OpenCTF
- an extension to DUnit to provide testing for components
I assume most people using newer versions of Delphi are using DUnitX, and that most people also use TestInsight to ensure their tests are executed when code changes are made. What framework do you use and why?
If I missed any, please let me know.
December 4th, 2020 at 7:54 am
Our mORMot framework features a test framework, for both Delphi 6+ and FPC.
It has enhanced features like advanced logging, and is also integrated with the interface stubbing/mocking features of the framework.
See https://github.com/synopse/mORMot/blob/master/SynTests.pas for the core source unit and https://synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_12 for the documentation.