6

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

2
  • 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 name Commented Jul 9, 2013 at 7:45
  • @MarjanVenema below found the name Commented Jul 9, 2013 at 10:49

3 Answers 3

7

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.

Sign up to request clarification or add additional context in comments.

6 Comments

DUnitLite seems alive and kicking and a very nice alternative indeed.
@MarjanVenema Are you sure? Last commit was 5 years ago. Perhaps it still works with modern Delphi, I don't know.
@MarjanVenema it is not alternative - but the very description it is just an add-on. The alternative is sourceforge.net/p/dunit2/code/97/log/?path=
Hmm, didn't spot that, colleague just tried porting it to 64 bit and that went fine under XE2. @Arioch'The: do you mean add on to DUnit? In that case it indeed isn't an alternative, should have looked more closely before posting then.
@Arioch'The you're welcome, but uh..., yeah..., don't rub it in please :-)
|
5

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.

Comments

4

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.

6 Comments

Interesting - I hadn't heard about that (I'm still using DUnit.) Do you know anything else about it? I found the first thread mentioning it here, but no blog articles etc that I could find...
I wonder if someone compared Dunit2 and DunitX. However since FPC community chosen Dunit2 to be base of their work, and since i expect FPC commmunity to be more active maintainers than what remained of Delphi community, i'd put more hopes on DUnit2 future.
@David M: That is where I first learned about it as well. I'm currently using DUnit, too. I don't know about any other information on DUnitX, but will try to make some time to try it out.
Arioch 'The: I put my hopes on whichever project best suits my needs. Time will tell.
@BruceMcGee well... frequently competing projects do ave some official comparison, commercial ones do it as part of marketing, non-commercial ones do it for self-identification. Like... like ffmpeg.org and libav.org or like Xfree86 and X.org - they usually have some manifesto "why we did not like the old thing and why we took our toys and went away" - i just thought that DUnitX and DUnit2 projects know of each other and have some opinion why the other one is suboptimal. Of course they may be like LLVM and Portable.Net when none is technically better and the popularity would decide the survival
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.