Test::Legal - Test and (optionally) fix copyright notices, LICENSE file, and relevant field of META file
use Test::Legal; copyright_ok; license_ok; # Or, to fix things at the same time use Test::Legal -core => { actions =>['fix']}; # Here is the more refined way to acomplish the same thing use Test::Legal copyright_ok => { dirs=> [qw/ sctipt lib /] } , 'license_ok' , defaults => { base=> $dir, actions => [qw/ fix /]} ; # Note, The "actions=>['fix']" automatically fixes things so it can pass testing
Checks for (a) copyright notices in .pl and .pm distribution files; (b) for author entry in META.yml or META.json, which ever peresent; and (c) for existence of LICENSE file, with the correct license text autogenerate if so desired. Although you can alwyas add copyright notices manually to files, Test::Legal can fix things for you if operated in 'fix' mode (see bellow); alternatively, use the tools available in script/ named copyright-injection.pl an license-injection.pl .
When "fix" mode is requested, most issues are automatically fixed so testing succeeds with a harmless note() send to Test::Harness.
Assumptions: $arg exists and has been validated Input: the user arguments (a hashref) Output: TRUE if "dry" mode was specified, otherwise FALSE
copyritht_ok; legal_ok;
disable_test_builder annotate_dirs deannotate_dirs
copyright_injection.pl ( provided with Test::Legal ) Test::Copyright
Tambouras, Ioannis <ioannis@cpan.org>
Copyright (C) 2011 by Ioannis Tambouras
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.1 or, at your option, any later version of Perl 5 you may have available.
To install Test::Legal, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Legal
CPAN shell
perl -MCPAN -e shell install Test::Legal
For more information on module installation, please visit the detailed CPAN module installation guide.