FPCUnit: the Unit Testing framework for Free Pascal |
||
Powered by Free Pascal |
A collaboration with Michaël Van Canneyt was started to include the FPCUnit in the
Free Pascal distribution.
In this occasion the FPCUnit was refactored to remove the dependency on EOS and to make FPCUnit as similar as
possible to JUnit.
Now FPCUnit is officially part of the Free Pascal FCL, you'll find it in the recent 2.0 Free Pascal release
under the /fpc/fcl/fpcunit folder.
Michaël Van Canneyt, the developer responsible for the Free Pascal documentation, has written an article about unit testing
with FPCUnit in Free Pascal, published by the german magazine Toolbox 3'2005
http://www.toolbox-mag.de/toolbox.html:
Lazarus- und FPC-Code testen mit FPCUnit - Ein testframework für die freie Pascal-Variante
A graphical frontend is available for the Lazarus IDE. Thanks to Vincent Snijders who built a Lazarus package it integrates
nicely with the IDE.
As the framework follows closely the original JUnit code base, developers already familiar with JUnit will find themselves
at home with this port to Free Pascal.
If you are new to unit testing and test driven
development, you can find a huge reference to articles and
howto's on the JUnit home page:
JUnit documentation
JUnit articles.
A simple example of a console test runner application that was used to write FPCUnit itself
is included in the demo directory.
To make things easier for those new to unit testing, I've ported to Free Pascal the same example with the Money
and Money Bag class used in the famous
article Test Infected:
Programmers Love Writing Tests written by Kent Beck and Erich Gamma
Kent Beck: Test-Driven Development By Example (2002 Addison - Wesley)
Vincent Massol with Ted Husted: JUnit in Action (2004 Manning Publications Co.)
Happy coding.
Dean Zobec
Wednesday May 25 22:05:15 CET 2005