XT::Util - utility functions for test scripts
In xt/02pod_coverage.t:
use Test::More; use Test::Pod::Coverage; use XT::Util; my @modules = @{ __CONFIG__->{modules} || [] }; pod_coverage_ok($_, "$_ is covered") foreach @modules; done_testing(scalar @modules);
In xt/02pod_coverage.config:
{ "modules": ["Local::MyModule1", "Local::MyModule2"] }
These utilities are aimed at making test cases easier to reuse.
They do not directly help you write test cases or output TAP.
__CONFIG__($testfile)
Where $testfile is a filename like "foo.t", will strip ".t" from the end of the file name, add ".config", slurp the contents and parse them as JSON, returning the result.
$testfile
If $testfile is omitted, then uses the caller's filename.
By moving project-specific information (e.g. file names, package names, etc) into config files, the test file itself can be shared between projects.
If no appropriate config file is found, an empty hashref is returned. This is by design.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=XT-Util.
XT::Manager.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install XT::Util, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XT::Util
CPAN shell
perl -MCPAN -e shell install XT::Util
For more information on module installation, please visit the detailed CPAN module installation guide.