what is the options for unit testing in delphi XE4? i'm trying to use DUnit but it seems didn't have any official version for XE4 and source didn't compile
Developing Delphi DUnit TestsAdd(x, y: Integer): Integer; begin Result := x + y; end; function TCalc. Sub(X, Y: Integer): Integer; begin Result := x - y; end; end. The following example shows the test case skeleton file that you need to modify to test the two functions, Add and Sub, in the preceding code.
You can use Cypress for unit and integration testing. All tests are written in JavaScript and run in real browsers. Cypress provides an integrated development environment (IDE) that you can load in your browser.
Delphi has for a long time, and XE4 is no different, shipped with DUnit. You need to make sure that you select it in the install options.
The version that is shipped with Delphi is already updated to work with the version of Delphi that it ships with. Looking at the DUnit sourceforge project, it seems rather moribund. The last commit to the SVN archive that mentions Delphi versions is for Delphi 2009. So it seems clear to me that you are best sticking with the version that ships with Delphi.
You may be interested with the unit testing features available within our mORMot Open Source framework. See this StackOverflow answer.
In addition with unit testing with classes, just like DUnit, you have at hand a whole mocking/stubbing framework.
Using interfaces, in a SOLID context, is therefore more integrated within this framework than with DUnit. For instance, interface mocking directly links to a test case, so is able to be integrated within the unit test suit.
It is perfectly working with Delphi XE4, in both 32 bit and 64 bit Windows platforms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With