Unit testing
This list will evolve over time with useful items for unit testing in Delphi.
DUnit IDE integration
This is an early release. There are still some bugs to be worked out. This package is intended for BDS2006 but may also work on earlier version of Delphi. Please see the instructions on how to use it:
Building:
The package is setup use the JEDI JCL. I handled this by creating an environment variable $(JCL) to point to the directory in which I have the jcl installed. Do this or overwrite the search path in the package options to agree with your environment.
Using this package:
Either open an existing project or begin a new one. Then:
- Open the project manager and add a new DLL project.
- In the DLL source add this define: {$DEFINE TESTPROJECT}
- Export the RegistedTests function from TestFramework.pas with the name “Test”
- Add your test cases to this new DLL project.
- The default keyboard shortcut is ALT+CTRL+;. You can also run tests by Project\Test Project
When you run your tests a new tab in the message window will open called “Tests”. You will find the test output there. Double-clicking on any failures will take you to that line in the specified file (see known issues about this).
Known issues:
- Sometimes the stack trace shows a test failure as occuring in TestFramework.pas instead of the unit in which the test resides.
Here is this the code: dunitide100.zip
DUnit console runner
This implementation of the DUnit console runner is intended to work like the NUnit console runner. The xml output from XMLTestRunner.pas has been altered to produce results similar to that of the NUnit console runner. Useful if you have to use both DUnit and NUnit in the same build cycle.
Here is the code: dunit-console.rar

Hi.
Any chance of getting your console runner working with Delphi 2007 and the integrated DUnit?
Thanks.
Awesome post. Keep more information like this coming!
I recently came accross your blog and have been reading along. I thought I would leave my first comment.
I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Anyway - All are working
thank you for showing how unit testing should be done.
Thanks for posting such useful items. I’ve been reading his blog with much interest. He’s certainly raised my awareness. This post is Well Organized and Informative.
I came accross your blog and have been reading along. I thought I would leave my first comment.
I dont know what to say except that I have enjoyed reading. Nice blog.
Simple and informative post thanks, keep walking.
sO
so, what was the outcome of the testing.?
well then yes. I agree with you lifestyle design/
I came accross your blog and have been reading along.
it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity!
I’ve been reading his blog with much interest. Nice blog. I will keep visiting this blog very often.