Perl Unit

PerlUnit - an xUnit TestingFramework for PerlLanguage


PerlUnit is now a project on sourceforge. You can find us here: http://sourceforge.net/projects/perlunit

'Us', for the moment, means:

and some other folks, who aren't so active on the project any more. (Adam is however looking for someone to replace him as his current job doesn't leave time for maintaining this project properly)

Our aims can be summed up in this comment by ChristianLemburg:

For a start, I suggest that our joined effort to provide a real Whatever-it-is-called-Unit should meet the following requirements:

These aims have pretty much all been achieved now, and the TODO list has moved on to greener pastures.

Most of the comments that were here have been moved to 'ExtendingPerlUnit' for posterity, if you want to contribute comments, etc., please do so on one of our new sourceforge mailing lists, perlunit-users or perlunit-devel:

http://sourceforge.net/mail/?group_id=2653

For older discussion, see our open discussion forum, here:

http://sourceforge.net/forum/forum.php?forum_id=7840&et=0

Documentation is available as pod embedded within the modules, accessible via perldoc in the usual way.

Unfortunately for those of us who are new to test-first development, the perldoc documents seem to assume one is already an expert in XUnit type testing. For example there are terms that go undefined (# your state for fixture here... (what is a "fixture"?)). Also, the perldoc for Test::Unit::TestSuite does not show how to build a suite of tests from Test::Unit::TestCase. I would have thought that one would write unit tests with TestCase, then run them with a TestSuite. We need a complete example of how the different classes work together, with all the ...'s filled in and the new terms defined. In this example from perldoc Test::Unit::TestSuite: $suite->add_test(MySuite1->new()); why is it calling MySuite1->new() and not MyTestCase1->new()? It would be great to see more information on this, so we could have something to bridge the gap between DirtSimplePerlUnitExample and the real-world correct usage that at this moment can only be psychically intuited by us beginners.


Those looking for a Perl xUnit framework might also want to look at PerlTestClass.


Test::Unit is old and crappy. The Test::Unit::Lite is 100% compatible with Test::Unit and fixes some Test::Unit's bugs. Also try Test::Assert and Test::Mock::Class as complement for Test::Unit::Lite.


CategoryPerl CategoryTesting

EditText of this page (last edited April 16, 2009) or FindPage with title or text search