TestMaker - Create test class classes from your existing lib/
version 1.1
testMaker
To be run in base dir of project
assuming existing structure:
will create
Test::Class test runner
Test::Class custom base class
A test class based on lib/My/Class.pm
A test class based on lib/My/Class/Stuff.pm
If you have an existing structure of classes in /lib running this script will create a skeleton Test::Class test class for each. Within that test class each of the subs in you lib class will have a test sub created with a can_ok test.
The test classes will contain test subs, with a use_ok for that sub. The custom base test class, as parent, will make sure each child test class on startup performs a use_ok for the lib class you are testing
The script expects to be run in the base of your project (eg the dir which contains lib/ t/ and so on).
Should a Test::Class test runner not exist one will be created.
A custom base class will also be created if it does not exist, which all test classes created by this script inherit from.
Once the script has been run, all being well, you will be able to run your test suite from the base dir of your project using
prove -lv --merge
This script performs a check for Test::Class, Test::More and Class::Data::Inheritable and will complain at you if they are not installed. To go ahead and run the script anyway use the -f flag:
testMaker.pl -f
It currently does not filter out any sub definitions which are contained within pod sections of your class, and probably never will.
Test::Class
Class::Data::Inheritable
Test::More
Test::Most
Based on the excellent tutorial on Test::Class by Curtis "Ovid" Poe, <ovid at cpan.org> found here
Tom Beresford <me at tomberesford dot co dot uk>
This software is copyright (c) 2013 by Tom Beresford.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install TestMaker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TestMaker
CPAN shell
perl -MCPAN -e shell install TestMaker
For more information on module installation, please visit the detailed CPAN module installation guide.