Test-StubGenerator
Test::StubGenerator - A simple module that analyzes a given source file and automatically generates t/*.t style tests for subroutines/methods it encounters.
Test::StubGenerator does a fair job of analyzing a given source file and automatically creating testing stubs suitable for unit testing your module.
Test::StubGenerator make use of PPI in order to parse your module, looking for constructors and methods for modules (.pm), and subroutines for Perl script files (.pl).
Test::StubGenerator also optionally runs the generated tests through Perl::Tidy before returning the text of the tests to you.
Test::StubGenerator grew out of a vim plugin that created test stub files in a very similar fashion. However, the line-based nature of vimscript quickly indicated that adding default parameters to the tests would prove to be an exercise in futility. As this was a feature I very much wanted to implement, I naturally turned to Perl, and PPI.
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the perldoc command.
perldoc Test::StubGenerator
You can also look for information at:
Search CPAN
http://search.cpan.org/dist/Test-StubGenerator
CPAN Request Tracker:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-StubGenerator
AnnoCPAN, annotated CPAN documentation:
http://annocpan.org/dist/Test-StubGenerator
CPAN Ratings:
http://cpanratings.perl.org/d/Test-StubGenerator
COPYRIGHT AND LICENCE
Copyright (C) 2007-2009 Kent Cowgill
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.