I've used Test::Unit, and really like it. One of the nice things about perl is that it is very good language for writing self-testing routines in.
When you can, have the tests run outside the production environment. This isn't doable for everything, but offload as much as you can to 'make test' and 'make check' kinda tests.
Another good place to test modules is when they are loaded. Have modules register with a central module to announce themselves, when they call GateKeeper::register() use the caller(0) information to perform any runtime tests on the newly loaded module
package GateKeeper;
use strict;
my $package_list = {};
sub register {
my ($package) = caller();
perform_tests($package); # ensure all required subs are defined
$package_list->{$package} = $package->cvs_version(); # cvs_version(
+) sub is tested in perform_tests
}
# other subs to query cvs version info and other fun stuff
Someday I plan on posting a more complete version of registration and testing of virtual interfaces to PM, but today isn't going to be that day.
-jackdied |