Test::Skip - Framework to skip tests unless conditions are met
# load time decision, all the tests in the file will be skipped # unless all the conditions are met use Test::Skip { description => 'pre-requisits to test XXX', # dump all the condition and their state unless all conditions are met verbose => 1, unless_has => { executables => [ '/usr/bin/rsync', 'git' ], modules => ['IPC::Run', ['Data::TreeDumper' => 0.36 ]] , os => [ 'linux', ['Win32' => 'XP']] }, if_has => { modules => { error_text => 'module "Safe" is too old!', modules => ['Safe' => '<2.26'] }, user_check => { 'command ps(1) does not supply VSIZE' => \&check_ps_for_VSIZE_field, }, } # use existing modules that implement Skip functionality plugins => {executables => 'Test::Skip::UnlessExistsExecutable'}, } ; #--------------------------------------------------- # run time decision use Test::Skip qw(:skip_all_test) ; # single pre-requisits # skip_all_tests_unless 'modules' => 'IPC::Run, 'no IPC::Run, needed for test xxx' ; skip_all_tests_if 'modules' => ['Safe' => '<2.26'], 'tests need modern versions of Safe' # many pre-requisits skip_all_tests \%prerequisits, 'text displayed if tests are skipped' ; #--------------------------------------------------- # run time decision, Test::Block style use Test::Skip qw(:skip_test) ; skip_tests_if 'modules' => ['Safe' => '<2.26'] { # many tests using a moder Safe in this block }, 'tests need modern versions of Safe' ; my %prerequisits = { unless_has => { executables => '/usr/bin/rsync', ...}, if_has => { ... }, } ; skip_tests \%prerequisits { # many tests in this block }, 'prerequists missing for test XXX' ;
* This is a placeholder with no implementation yet. Please give feedback on the API *
This module implements a framework that skips tests unless the specified pre-requisits are met.
None so far.
Nadim ibn hamouda el Khemir CPAN ID: NKH mailto: nadim@cpan.org
Copyright 2010 Nadim Khemir.
This program is free software; you can redistribute it and/or modify it under the terms of either:
the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
the Artistic License version 2.0.
You can find documentation for this module with the perldoc command.
perldoc Test::Skip
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Test-Skip
RT: CPAN's request tracker
Please report any bugs or feature requests to L <bug-test-skip@rt.cpan.org>.
We will be notified, and then you'll automatically be notified of progress on your bug as we make changes.
Search CPAN
http://search.cpan.org/dist/Test-Skip
Test::Skip::UnlessExistsExecutable, Test::Requires
To install Test::Skip, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Skip
CPAN shell
perl -MCPAN -e shell install Test::Skip
For more information on module installation, please visit the detailed CPAN module installation guide.