6
votes

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

3
additionally there is DUnit2 project but it does not seem to be complete yet. wiki.freepascal.org/FPTest There also was someone''s project to enhance DUnit with additional classers, but don't remember the nameArioch 'The
@MarjanVenema below found the nameArioch 'The

3 Answers

7
votes

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.

5
votes

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.

4
votes

There is a new project called DUnitX. It is intended to take advantage of newer features in the language and framework and works with Delphi 2010 and later.

Still very much a work in progress, but it is currently active and you will probably recognise some of the people who are working on it.