Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unit testing tool for delphi XE4

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

like image 971
vesal Avatar asked Jul 09 '13 07:07

vesal


People also ask

How do you use DUnit in Delphi?

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.

Can I use Cypress for unit testing?

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.


2 Answers

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.

like image 56
David Heffernan Avatar answered Nov 15 '22 08:11

David Heffernan


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.

like image 25
Arnaud Bouchez Avatar answered Nov 15 '22 08:11

Arnaud Bouchez