[Pas-dev] another proposal Test::Unit::TestCase
Status: Beta
Brought to you by:
mortis
From: Kyle R . B. <mo...@vo...> - 2002-05-17 15:53:43
|
Test::Unit::TestCase is the Perl equivalent of JUnit. I've used it at my current employer and would like to institute it's use in Pas. Again, it's not Java (I have also used the C++ version), it's just a good unit testing framework. You write your test cases like this: package ObjectTest; # tests Object use strict; use warnings; use Test::Unit::TestCase; use Test::Unit::Assertion::Boolean; our @ISA = qw( Test::Unit::TestCase ); sub test_construction { my($self) = @_; my $obj = Object->new(); $self->assert( $obj, "Error, construction failed" ); } Then you run it with a simple test runner -- I usualy write one that finds all .pm files that end in *Test.pm and create a test suite, then runs them all in a single suite -- that way it's one command to run the entire set of unit tests. I would _really_ like to institute this. It makes writing unit tests stupid simple. The easier that is, the more likely it is that we'll have unit tests to begin with. Votes? +1/-1? My vote is of course +1 k -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |