GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::IF (3)

.ds Aq ’

NAME

Test::If - Test only if ...

CONTENTS

VERSION

Version 0.01

SYNOPSIS

Generic usage



    use Test::More;
    use Test::If Test::Something, [ tests => N ];
   
    # Is equal to
   
    use Test::More;
    eval q{ use Test::Something; 1 } or plan skip_all => Module Test::Something required for this test;
    plan tests => N;

   
    use Test::More;
    use Test::If sub { $ENV{TEST_AUTHOR} }, [ tests => N ];
   
    # Is equal to
   
    use Test::More;
    $ENV{TEST_AUTHOR} or plan skip_all => "Test condition not met";
    plan tests => N;



You can also combine options and it is allowed to omit plan options, if it is runned by loaded module or you want to load it manually

For example common pod-coverage.t:



    use Test::More;
    use Test::If
        sub { $ENV{TEST_AUTHOR} },  # Checked first $ENV{TEST_AUTHOR}, otherwise skip
        Test::Pod::Coverage 1.08, # Use Test::Pod::Coverage of at least version 1.08
        Pod::Coverage 0.18,       # And want Pod::Coverage at least of version 0.18
    ;
   
    all_pod_coverage_ok();



If some of conditions will not be met, test will be skipped.

AUTHOR

Mons Anderson, <mons at cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Mons Anderson, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::IF (3) 2009-11-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.